Skip to content

Latest commit

 

History

History
47 lines (36 loc) · 2.01 KB

InstallModules.md

File metadata and controls

47 lines (36 loc) · 2.01 KB

Instructions to install the what-if PS module

$password = ConvertTo-SecureString "YOUR PAT FROM THE CREATING THE PREVIOUS STEP" -AsPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential "YOUR EMAIL FOR AZURE DEVOPS SERVICES", $password
Register-PSRepository -Name WhatIfRepository -SourceLocation https://pkgs.dev.azure.com/AzDeploymentWhatIf/WhatIfModules/_packaging/WhatIfFeed/nuget/v2 -PackageManagementProvider Nuget -InstallationPolicy Trusted -Credential $credential
Install-Module -Name Az.Resources -Repository WhatIfRepository -RequiredVersion 2.0.1-alpha5 -AllowPrerelease -AllowClobber -Credential $credential -SkipPublisherCheck
  • If you want to switch back to another installed version, simply run:
Import-Module Az.Resources -RequiredVersion <version_number>
  • To check if there's a newer version, do:
Find-Module -Name Az.Resources -Repository WhatIfRepository -AllVersions -AllowPrerelease -Credential $credential
  • If you are done testing the package, you may uninstall it by running:
Uninstall-Module -Name Az.Resources -RequiredVersion 2.0.1-alpha5 -AllowPrerelease

Known issue

If you are using the default version of the PowerShellGet module, you may encounter Unable to resolve package resource error when running the commands above. You can fix it by updating PowerShellGet to the newest version:

Uninstall-Module PowershellGet
Install-Module PowerShellGet -Force

Once the update is done, restart your PowerShell session and you should be able to install the What-If module.