-
Notifications
You must be signed in to change notification settings - Fork 0
/
profile.ps1
29 lines (24 loc) · 1.12 KB
/
profile.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
### Global Variables ###
$scriptPath = Split-Path -Parent $MyInvocation.MyCommand.Definition #Directory where the script is located
$functionDir = "$scriptPath\Functions-AutoImported\"
### Credentials are Processed ###
# To function properly encrypted password must be decrypted on same pc by same user who encrypted it
$user = "dummyuser@lab.local"
$encrypted = Get-Content "$scriptPath\lab.local.txt"
$password = ConvertTo-SecureString -String $encrypted
$cred_lab = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $user,$password
$user = "dummyuser@prod.local"
$encrypted = Get-Content "$scriptPath\prod.local.txt"
$password = ConvertTo-SecureString -String $encrypted
$cred_prod = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $user,$password
### Custom Functions Imported ###
$functionList = (ls $functionDir).Name
foreach ($function in $functionList) {
Import-Module ($functionDir + $function)
}
### Set Starting Location ###
Set-Location "C:\"
### Customize the console display ###
$UI = (Get-Host).UI.RawUI
#$UI.BackgroundColor = "blue"
#$UI.ForegroundColor = "white"