This repository includes my various scripts and modules for PowerShell.
Open PowerShell as Administrator, navigate to scripts folder, then:
# Clone PowerShell scripts
$ cd $env:USERPROFILE; mkdir Repos; cd Repos; mkdir PowerShell; cd PowerShell
$ git clone https://github.com/ethanmiller1/PowerShell.git
# Run basic setup scripts
$ .\BasicSetup.ps1Note: You may encounter errors when running scripts from your work network. Run scripts at home.
https://chocolatey.org/install
To run .ps1 scripts, select File > Open Windows PowerShell > Open Windows PowerShell as administrator
If you encounter the following error while running scripts:
.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
Simply run this in your PowerShell to add it as a function:
# Sets Execution Policy to unrestricted before executing the command passed.
function Execute([string] $cmd)
{
powershell `
-NoProfile `
-ExecutionPolicy unrestricted `
-Command $cmd
}And then:
Execute ".\BasicSetup.ps1"