NetSPI / PowerUpSQL

PowerUpSQL: A PowerShell Toolkit for Attacking SQL Server
Other
2.44k stars 460 forks source link

Cannot install, 'Get-SqlAgentJob' is already available #45

Closed Liturgist closed 5 years ago

Liturgist commented 5 years ago

When I try to install using Install-Module -Name PowerUpSQL, the error message reported is:

PackageManagement\Install-Package : A command with name 'Get-SqlAgentJob' is already available on this system. This module 'PowerUpSQL' may override the existing
commands. If you still want to install this module 'PowerUpSQL', use -AllowClobber parameter.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1772 char:21
+ ...          $null = PackageManagement\Install-Package @PSBoundParameters
+                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Exception
    + FullyQualifiedErrorId : CommandAlreadyAvailable,Validate-ModuleCommandAlreadyAvailable,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

Does this supercede the command from the Microsoft SqlServer module?

nullbind commented 5 years ago

Yeah, at the moment the function names are the same. However, most of the time the commands aren’t being run on a system where sql server is installed. If it is, I think you just have to use the force flag when you import the module into your session. Maybe down the road I’ll rename the function so it doesn’t conflict. Hopefully that helps for now.