Skip to content

Commit

Permalink
📝 fix winssh.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
xiagw committed Nov 8, 2023
1 parent 4d4e786 commit f75a22c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions docs/bin/win.ssh.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
## 查看当前的执行策略 # Get-ExecutionPolicy -List
## 设置执行策略为要求远程脚本签名,范围为当前用户 # Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
## in-china # irm https://gitee.com/xiagw/deploy.sh/raw/main/bin/win.ssh.ps1 | iex
## not-china # irm https://github.com/xiagw/deploy.sh/raw/main/bin/win.ssh.ps1 | iex
## 查看当前的执行策略
# Get-ExecutionPolicy -List
## 设置执行策略为要求远程脚本签名,范围为当前用户
# Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
## in-china # irm https://gitee.com/xiagw/deploy.sh/raw/main/docs/bin/win.ssh.ps1 | iex
## not-china # irm https://github.com/xiagw/deploy.sh/raw/main/docs/bin/win.ssh.ps1 | iex

## https://github.com/massgravel/Microsoft-Activation-Scripts
# irm https://massgrave.dev/get | iex
Expand Down Expand Up @@ -67,15 +69,15 @@ Add-Content -Path $PROFILE -Value 'Set-PSReadlineKeyHandler -Key Tab -Function M
Add-Content -Path $PROFILE -Value 'Set-PSReadLineOption -EditMode Emacs'
Add-Content -Path $PROFILE -Value '# $env:HTTP_PROXY="http://192.168.41.252:1080"'
Add-Content -Path $PROFILE -Value '# $env:HTTPS_PROXY="http://192.168.41.252:1080"'
if (oh-my-posh.exe --version) {
if (Get-Command oh-my-posh.exe) {
Write-Host "oh-my-posh already installed"
} else {
Set-ExecutionPolicy Bypass -Scope Process -Force
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://ohmyposh.dev/install.ps1'))
# winget install JanDeDobbeleer.OhMyPosh --source winget
# scoop install https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/oh-my-posh.json
}
if (oh-my-posh.exe --version) {
if (Get-Command oh-my-posh.exe) {
Add-Content -Path $PROFILE -Value 'oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH/ys.omp.json" | Invoke-Expression'
}

Expand Down

0 comments on commit f75a22c

Please sign in to comment.