Skip to content

Use of built-in PowerShell commands should be renamed or removed #22

@wsmelton

Description

@wsmelton

The module contains Import-Certificate which is a built-in command for Windows PowerShell in Windows 8 and above. So trying to install this module fails with the below error due to this.

It would better to either remove the command from the module or rename it where it will not overwrite the local command.

06-08 21:26:13 C:\WINDOWS\system32> install-module pssoftware
PackageManagement\Install-Package : The following commands are already available on this system:'Import-Certificate'.
This module 'PSSoftware' may override the existing commands. If you still want to install this module 'PSSoftware',
use -AllowClobber parameter.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1809 char:21
+ ...          $null = PackageManagement\Install-Package @PSBoundParameters
+                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package],
   Exception
    + FullyQualifiedErrorId : CommandAlreadyAvailable,Validate-ModuleCommandAlreadyAvailable,Microsoft.PowerShell.Pack
   ageManagement.Cmdlets.InstallPackage

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions