# Add Python and Python Scripts to path
$env:Path = [System.Environment]::GetEnvironmentVariable("Path", [System.EnvironmentVariableTarget]::Machine)
$PythonPath = "C:Python27"
$PythonScriptsPath = "C:Python27Scripts"
if ($env:Path -notlike "*$PythonPath*") {
$env:Path = $env:Path + ";$PythonPath"
}
if ($env:Path -notlike "*$PythonScriptsPath*") {
$env:Path = $env:Path + ";$PythonScriptsPath"
}
# Save to machine path
[Environment]::SetEnvironmentVariable( "Path", $env:Path, [System.EnvironmentVariableTarget]::Machine )
# Check machine path
[System.Environment]::GetEnvironmentVariable("Path", [System.EnvironmentVariableTarget]::Machine)