Skip to content

Instantly share code, notes, and snippets.

@jwmoss
Last active May 19, 2021 19:02
Show Gist options
  • Save jwmoss/d15cf07ad0a088b9b552d69b82932403 to your computer and use it in GitHub Desktop.
Save jwmoss/d15cf07ad0a088b9b552d69b82932403 to your computer and use it in GitHub Desktop.
Provision new workspace with necessary modules
$modules = @(
"ImportExcel",
"PoshRSJob",
"PowershellGet",
"Invoke-CommandAs",
"PSFramework",
"Posh365"
)
## Force TLS 1.2
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
## Install Nuget
Get-PackageProvider -Name Nuget -ForceBootstrap | Out-Null
## Trust PSGallery
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
## Set execution policy
Set-ExecutionPolicy Unrestricted -Force
## Install the modules
Install-Module $modules -Scope CurrentUser -Force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment