Created
July 18, 2022 17:50
-
-
Save clemmesserli/8d109219c84dd2f689afe1dd5fb21c5b to your computer and use it in GitHub Desktop.
Simple script to point VSCode, ISE, and Terminal for v5 + v7 at a single profile.ps1 file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$files = @( | |
"C:\Program Files\PowerShell\7\profile.ps1" | |
"C:\Program Files\PowerShell\7\Microsoft.PowerShell_profile.ps1" | |
"C:\Windows\System32\WindowsPowerShell\v1.0\Microsoft.PowerShell_profile.ps1" | |
"C:\Windows\System32\WindowsPowerShell\v1.0\Microsoft.PowerShellISE_profile.ps1" | |
"C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1" | |
"$($env:onedrive)\PowerShell\Microsoft.PowerShell_profile.ps1" | |
"$($env:onedrive)\PowerShell\profile.ps1" | |
"$($env:onedrive)\WindowsPowerShell\Microsoft.PowerShell_profile.ps1" | |
"$($env:onedrive)\WindowsPowerShell\Microsoft.PowerShellISE_profile.ps1" | |
"$($env:onedrive)\WindowsPowerShell\profile.ps1" | |
) | |
foreach ($file in $files) { | |
Set-Content -Value '. C:\github\profile.ps1' -path $file -Force | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment