Quantcast
Channel: SAPIEN Forums
Viewing all articles
Browse latest Browse all 480

PowerShell • Publish-Module Error

$
0
0
Hi,

I declare a local repository with the following command :

Code:

$RepoName = "REPONAME"
$RepoUNcPath "\\Path\Share"
$RepoInstallationPolicy = 'Trusted'

$registerPSCd22Repository = @{
Name = $RepoName
SourceLocation = $RepoUNcPath
ScriptSourceLocation = $RepoUNcPath
InstallationPolicy = $RepoInstallationPolicy
}
Register-PSRepository @registerPSCd22Repository
Now my goal is publishing a module in this local repository.
For that I use the command (found on the microsoft documentation) :

Code:

$RepoName = "REPONAME"
$NuGetApiKey = 'AnyStringWillDo'
$publishModule = @{
Path = "c:\Path\Of\The\Psd1\File"
Repository = $RepoName
NuGetApiKey = $NuGetApiKey
}
Publish-Module @publishModule
or

Code:

Publish-Module -Path "c:\Path\Of\The\Psd1\File" -Repository "REPONAME" -Verbose
But with the both command above I got the following error :

Code:

Publish-PSArtifactUtility : Failed to generate the compressed file for module 'C:\Program Files\dotnet\dotnet.exe failed to pack: error
'.
Au caractère C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\2.2.5\PSModule.psm1:10990 : 17
+ ... Publish-PSArtifactUtility @PublishPSArtifactUtility_Param ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation : (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : FailedToCreateCompressedModule,Publish-PSArtifactUtility



For more information, here below the powershell version :
Name Value
---- -----
PSVersion 5.1.20348.2110
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.20348.2110
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1


OS : Windows Server 2022 Datacenter
Version : 21H2
Build : 20348.2159
Language : Français

Can you tell me how I can fix this error ?


Best Regards

Statistics: Posted by yves22 — Tue Jan 02, 2024 2:15 am



Viewing all articles
Browse latest Browse all 480

Trending Articles