分类: powershell

29 篇文章

macOS 下检测移动硬盘速度脚本
脚本 自动判断当前插入的移动硬盘的盘符, 如果有多个移动硬盘, 显示列表, 由使用者选择测试的移动硬盘 从 关于本机 | 系统报告 | USB 信息 中读取当前协商速度 有时速度太慢, 可能与移动硬盘插入速度有关, 快速速度过慢可能会被协商为 2.0 的速度 # 1. 权限预热 Write-Host "--- 权限验证 ---"…
bilibili mp3 下载脚本
下载脚本 bbdowner.ps1 # 从 bilibili 下载视频并转为 mp3 # 调用了 bbdown 命令, dotnet tool install -g bbdown # 调用了 ffmpeg 命令, brew install ffmpeg $ErrorActionPreference = 'stop' # 兼容一些…
PWSH AI 查词、发音
演示如何使用 powershell 编写调用 AI 查询单词释义、调用 TTS 生成发音文件并进行播放的例子 可以定义 shell 环境, code $PROFILE 加入快捷调用函数,比如 wd word (脚本见最后) 单词查询脚本 <# .DESCRIPTION 查询单词 .EXAMPLE .\SearchWork.ps1 -word …
PWSH 调用 AI
微软有一个 AISH 工具,但是命令行调用功能不完善。下面使用 https://github.com/chenxizhang/openai-powershell​ ‍ 安装 # 安装 Install-Module -Name code365scripts.openai -Scope CurrentUser #更新 Update-Module -Na…
ubuntu ps1 设置网卡参数
cat /opt/bin/NetworkParamUpdater.ps1 # NetworkParamUpdater.ps1' -Auto 将当前连接设置为自动分配 ip # NetworkParamUpdater.ps1' -Ip '192.168.1.1' 将当前连接设置为指定 ip [CmdletBin…
ubuntu 创建桌面快捷方式
make-shortcut.sh #!/bin/bash # 初始命令 COMMAND="pwsh /opt/bin/make-shortcut.ps1" # 如果有参数,则追加参数 if [ "$#" -gt 0 ]; then COMMAND="$COMMAND $@" fi # 执行…
pwsh 发送钉钉机器人消息
# 钉钉消息发送 $ErrorActionPreference = 'Stop' # 钉钉消息推送相关 class DingMessage { [string] $secret = "" [string] $ServerUrl = "" [void] send($title, $messa…
发送微信消息的一种方式
2025-5-29 13:12:33 已被微信限制,要下载他们的 app 接收消息 https://wxpusher.zjiecode.com/ class Message { $appToken = "" Message($token) { $this.appToken = $token } send([array]$uids…
HeidiSQL 导出密码解密
https://www.fournoas.com/posts/how-to-recover-a-stored-password-from-heidisql/ function Decrypt { param( [string]$str ) if ([string]::IsNullOrEmpty($str)) { return ""…