-
Notifications
You must be signed in to change notification settings - Fork 8
Windows PowerShell 5.1
Michael Escamilla edited this page Sep 5, 2025
·
7 revisions
Below is a video walkthrough of the steps on this page:
OSDWorkspace Prerequisites: PowerShell 5.1
Set the execution policy to allow running local and remote scripts:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine -ForceNuGet is required for interacting with the PowerShell Gallery and managing modules. Install it if not already present:
if ($(Get-PackageProvider).Name -notcontains 'NuGet') {
Install-PackageProvider -Name NuGet -Force -Verbose
}Set the PowerShell Gallery (PSGallery) as a trusted repository to avoid confirmation prompts during module installation:
if ((Get-PSRepository -Name 'PSGallery').InstallationPolicy -ne 'Trusted') {
Set-PSRepository -Name 'PSGallery' -InstallationPolicy Trusted
Write-Host "PowerShell Gallery (PSGallery) has been set to Trusted."
} else {
Write-Host "PowerShell Gallery (PSGallery) is already Trusted."
}Install-Module -Name PowerShellGet -Force -Scope AllUsers -AllowClobber -SkipPublisherCheck -VerboseThis should have been updated as part of PowerShellGet, but if you encounter issues, you can run the following command to ensure it is up to date:
Install-Module -Name PackageManagement -Force -Scope AllUsers -AllowClobber -SkipPublisherCheck -Verbose