DaveWentzel.com            All Things Data

Scripting

 

Overview
scripting is disabled by default, due to execution policies.  The default is Restricted Execution.  More info available at signed scripts
 
 
Running Scripts
from the current directory:
.\<filename> (with or without the .ps1 extension)
 
You must always include the .\ since your current working folder is not part of the path.  They also did this for half-assed security reasons.  However, anyone could create an alias and run a malicious script anyway. 
 
Profiles
$((Split-Path $profile -Parent) + "\profile.ps1") :  Your current user profile path.
$pshome\profile.ps1:  All users profile path
 
 
 

Add new comment