forked from scottmuc/poshfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDeploy.ps1
More file actions
17 lines (13 loc) · 704 Bytes
/
Deploy.ps1
File metadata and controls
17 lines (13 loc) · 704 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
$here = Split-Path -Parent $MyInvocation.MyCommand.Path
$psUserProfile = "$env:USERPROFILE\Documents\WindowsPowerShell"
copy-item -Path $here\* -Destination $psUserProfile -Recurse -Force -Exclude('Deploy.ps1', 'Readme.md', '*.gitignore', '*.git')
Get-ChildItem $psUserProfile -Filter Microsoft.PowerShell*Profile* | `
Foreach-Object{
$file = $_.FullName
if(!(Get-Content -Path $file | Select-String -Pattern '#Pimped Profile Inlcude')){
Add-Content $file "`n #Pimped Profile Inlcude `n . `"$env:UserProfile\documents\WindowsPowerShell\PowerShell_Profile_Pimped.ps1`""
}
}
if(!(Test-Path $env:USERPROFILE\bin)){
New-Item -Type directory -Name bin -Path $env:USERPROFILE
}