-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHelperSetup.ps1
More file actions
23 lines (18 loc) · 804 Bytes
/
HelperSetup.ps1
File metadata and controls
23 lines (18 loc) · 804 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function Write-Color([String[]]$Text, [ConsoleColor[]]$Color) {
for ($i = 0; $i -lt $Text.Length; $i++) {
Write-Host $Text[$i] -Foreground $Color[$i] -NoNewLine
}
Write-Host
}
if ((Test-Path $Profile) -eq $false)
{
Write-Host "Creating Pofile" -ForegroundColor Yellow
New-Item -Path $Profile -Type file –Force
}
$psDir = (Get-Item $Profile).Directory.FullName
$installDir = $psDir + "\Modules"
Write-Host "Copying Helper Module" -ForegroundColor Yellow
Copy-Item -Path .\PSHelpers -Destination $installDir
Write-Host "Adding Alias To Profile" -ForegroundColor Yellow
Add-Content -Path $Profile -Value "`nSet-Alias -Name env -Value Get-EnvironmentVariables"
Write-Color -Text "Open a new PowerShell window and type ", "env", " to see it work" -Color Yellow,Green,Yellow