I am trying to install PowerShell Community Extensions (required to get Invoke-BatchFile
) within my docker:
FROM mcr.microsoft.com/windows/servercore:ltsc2022
[...]
RUN Install-Module Pscx -Scope CurrentUser -Confirm:$false -Force
The above always returns with the following error:
Install-NuGetClientBinaries : Exception calling "ShouldContinue" with "2"
argument(s): "Object reference not set to an instance of an object."
At C:\Program
Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1762 char:9
+ Install-NuGetClientBinaries -CallerPSCmdlet $PSCmdlet -Proxy ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-NuGetClientBinaries],
MethodInvocationException
+ FullyQualifiedErrorId : NullReferenceException,Install-NuGetClientBinari
es
How is one supposed to install Pscx ? Since PSCX is no longer distributed via Codeplex or as an MSI, but only on the Powershell Gallery I cannot use chocolatey.