PowerShell Step: Offline Nuget Bootstrap and Import-PackageProvider

I was denied posting for 22 hours, sorry about that.

I’ll use markdown in the future, thanks for the info. Get-PackageProvider -ListAvailable queries the internet but also queries the local machine, so it doesn’t need the internet but will warn if you’re not connected.

I did end up figuring this out.

  • 32-bit PowerShell was being executed. Found this by running [Environment]::Is64BitProcess() within the PowerShell pipeline step. Which seems to be invoked by Java.
  • Mistakenly had a 32-bit version of Java installed, so while my server was 64-bit, the Jenkins-controller was seeing it as 32-bit.
  • I tried uninstalling the 32-bit version of Java, installed a 64-bit version, deleted the agent, and the service, but recreated the agent, connected and the agent showed up as 64-bit, still 32-bit PowerShell was getting executed.
  • Deploy an entirely new server. Installed 64-bit Java, created new agent, connected, agent showed as 64-bit.

That last bullet point got me past the original issue and with a lot of fiddling around with string interpolation I’m now able to use Publish-Module to Artifactory using the PowerShell pipeline step.

Not sure why the uninstall/re-install didn’t work and kept invoking 32-bit powershell but I assume it has to deal with a Java configuration not getting refreshed.

1 Like