Managing Software with Chocolatey

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#Remember to run PowerShell as an administrator

#Connect to Workstation1
Enter-PSSession -ComputerName "WORKSTATION1"

#Install Chocolatey 
Set-ExecutionPolicy Bypass -Scope Process -Force 
Invoke-Expression((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

#Install 7zip
choco install 7zip

#Close the session.
Exit-PSSession
1
2
3
4
5
#Remember to run PowerShell as an administrator

Invoke-Command -ComputerName "WORKSTATION1" -ScriptBlock {Set-ExecutionPolicy Bypass -Scope Process -Force; 
Invoke-Expression((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'));
choco install 7zip}