]> us-delaporte.pagekite.me Git - dotfiles.git/blobdiff - setup/powershell.sh
Protect against modules that are not always cloned
[dotfiles.git] / setup / powershell.sh
old mode 100644 (file)
new mode 100755 (executable)
index a1d2c0e..5994882
@@ -1,6 +1,16 @@
-if [ ! -f ~/.config/powershell/Microsoft.PowerShell_profile.ps1 ]; then
-       echo "************** Link PowerShell profile"
-       chsh --shell /usr/bin/pwsh
-       mkdir -p ~/.config/powershell/
-       ln -s ~/dotfiles/Microsoft.PowerShell_profile.ps1 ~/.config/powershell/Microsoft.PowerShell_profile.ps1 
-fi
\ No newline at end of file
+
+echo "************** Link PowerShell profile"
+mkdir -p ~/.config/powershell/
+mv ~/.config/powershell/Microsoft.PowerShell_profile.ps1 ~/.config/powershell/profile.backup.ps1
+ln -s ~/dotfiles/files/Microsoft.PowerShell_profile.ps1 ~/.config/powershell/Microsoft.PowerShell_profile.ps1 
+
+echo "************** Install PowerShell"
+sudo snap install powershell --classic
+
+if ! [ -f /etc/shells ] || ! grep -q '^/snap/bin/powershell$' /etc/shells; then
+  echo "************** Add PowerShell to /etc/shells"
+  echo '/snap/bin/powershell' | sudo tee -a /etc/shells
+fi
+
+echo "************** Choose Shell: PowerShell"
+chsh --shell /snap/bin/powershell