Closed tonymet closed 5 months ago
The docs for v3 of PowerShellGet is for the proxy module. Publish-Module
is a proxy for Publish-PSResource
in the new Microsoft.PowerShell.PSResource module, which doesn't support the -Name
parameter.
The example works for PowerShellGet v2, but needs to updated for the v3 docs.
The docs for v3 of PowerShellGet is for the proxy module.
Publish-Module
is a proxy forPublish-PSResource
What tools can I use to see which one I have installed? Here are the local docs
❯ help Publish-PSResource
NAME
Publish-PSResource
SYNTAX
Publish-PSResource [-Path] <string> [-ApiKey <string>] [-Repository <string>] [-DestinationPath
<string>] [-Credential <pscredential>] [-SkipDependenciesCheck] [-SkipModuleManifestValidate]
[-Proxy <uri>] [-ProxyCredential <pscredential>] [-WhatIf] [-Confirm] [<CommonParameters>]
NAME
Publish-Module
SYNTAX
Publish-Module -Name <string> [-RequiredVersion <string>] [-NuGetApiKey <string>] [-Repository
<string>] [-Credential <pscredential>] [-FormatVersion {2.0}] [-ReleaseNotes <string[]>] [-Tags
<string[]>] [-LicenseUri <uri>] [-IconUri <uri>] [-ProjectUri <uri>] [-Exclude <string[]>] [-Force]
[-AllowPrerelease] [-SkipAutomaticTags] [-WhatIf] [-Confirm] [<CommonParameters>]
Publish-Module -Path <string> [-NuGetApiKey <string>] [-Repository <string>] [-Credential
<pscredential>] [-FormatVersion {2.0}] [-ReleaseNotes <string[]>] [-Tags <string[]>] [-LicenseUri
<uri>] [-IconUri <uri>] [-ProjectUri <uri>] [-Force] [-SkipAutomaticTags] [-WhatIf] [-Confirm]
[<CommonParameters>]
PS> Get-Module -ListAvailable PowerShellGet
Directory: C:\Users\useranem\Documents\PowerShell\Modules
ModuleType Version PreRelease Name PSEdition ExportedCommands
---------- ------- ---------- ---- --------- ----------------
Script 2.9.0 preview PowerShellGet Desk {Find-Command, Find-DscResource, Find-M…
Directory: C:\Program Files\PowerShell\Modules
ModuleType Version PreRelease Name PSEdition ExportedCommands
---------- ------- ---------- ---- --------- ----------------
Script 2.2.5 PowerShellGet Desk {Find-Command, Find-DSCResource, Find-M…
Directory: C:\program files\powershell\7.2\Modules
ModuleType Version PreRelease Name PSEdition ExportedCommands
---------- ------- ---------- ---- --------- ----------------
Script 2.2.5 PowerShellGet Desk {Find-Command, Find-DSCResource, Find-M…
Directory: C:\Program Files\WindowsPowerShell\Modules
ModuleType Version PreRelease Name PSEdition ExportedCommands
---------- ------- ---------- ---- --------- ----------------
Script 1.0.0.1 PowerShellGet Desk {Install-Module, Find-Module, Save-Modu…
Type of issue
Code doesn't work
Feedback
Publish-Module -Name
fails with the error "the module with name XYZ does not exist". The correct command isPublishModule -Path
Complete Working Example
Page URL
https://learn.microsoft.com/en-us/powershell/module/powershellget/publish-module?view=powershellget-3.x
Content source URL
https://github.com/MicrosoftDocs/PowerShell-Docs-PSGet/blob/main/powershell-gallery/powershellget-3.x/PowerShellGet/Publish-Module.md
Author
@sdwheeler
Document Id
6b49c538-9eea-8c90-18fa-c602979056e6