mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-08 00:54:04 +01:00
Update set-profile.ps1
This commit is contained in:
parent
43a92a1432
commit
21675577c1
@ -12,18 +12,18 @@
|
||||
#>
|
||||
|
||||
try {
|
||||
"⏳ Step 1/3 - Querying path to PowerShell profile 'CurrentUserCurrentHost'..."
|
||||
"⏳ (1/3) Querying path to PowerShell profile 'CurrentUserCurrentHost'..."
|
||||
$PathToProfile = $PROFILE.CurrentUserCurrentHost
|
||||
"$PathToProfile"
|
||||
|
||||
"⏳ Step 2/3 - Creating the profile (if non-existent)..."
|
||||
"⏳ (2/3) Creating the profile (if non-existent)..."
|
||||
$Null = New-Item -Path $profile -ItemType "file" -Force
|
||||
|
||||
"⏳ Step 3/3 - Copying my-profile.ps1..."
|
||||
"⏳ (3/3) Copying my-profile.ps1..."
|
||||
$PathToRepo = "$PSScriptRoot/.."
|
||||
Copy-Item "$PathToRepo/Scripts/my-profile.ps1" "$PathToProfile" -force
|
||||
|
||||
"✔️ updated PowerShell profile by my-profile.ps1 - it gets active on next login"
|
||||
"✔️ updated your PowerShell profile by my-profile.ps1 - it gets active on next login"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
Loading…
Reference in New Issue
Block a user