PWSH AI 查词、发音
演示如何使用 powershell 编写调用 AI 查询单词释义、调用 TTS 生成发音文件并进行播放的例子 可以定义 shell 环境, code $PROFILE 加入快捷调用函数,比如 wd word (脚本见最后) 单词查询脚本 <# .DESCRIPTION 查询单词 .EXAMPLE .\SearchWork.ps1 -word …
|
75
|
|
347 字
|
14 分钟
PWSH 调用 AI
微软有一个 AISH 工具,但是命令行调用功能不完善。下面使用 https://github.com/chenxizhang/openai-powershell 安装 # 安装 Install-Module -Name code365scripts.openai -Scope CurrentUser #更新 Update-Module -Na…
|
35
|
|
235 字
|
6 分钟
ubuntu ps1 设置网卡参数
cat /opt/bin/NetworkParamUpdater.ps1 # NetworkParamUpdater.ps1' -Auto 将当前连接设置为自动分配 ip # NetworkParamUpdater.ps1' -Ip '192.168.1.1' 将当前连接设置为指定 ip [CmdletBin…
|
595
|
|
151 字
|
8 分钟
ubuntu 创建桌面快捷方式
make-shortcut.sh #!/bin/bash # 初始命令 COMMAND="pwsh /opt/bin/make-shortcut.ps1" # 如果有参数,则追加参数 if [ "$#" -gt 0 ]; then COMMAND="$COMMAND $@" fi # 执行…
|
370
|
|
90 字
|
5 分钟
pwsh 发送钉钉机器人消息
# 钉钉消息发送 $ErrorActionPreference = 'Stop' # 钉钉消息推送相关 class DingMessage { [string] $secret = "" [string] $ServerUrl = "" [void] send($title, $messa…
|
444
|
|
123 字
|
7 分钟
发送微信消息的一种方式
2025-5-29 13:12:33 已被微信限制,要下载他们的 app 接收消息 https://wxpusher.zjiecode.com/ class Message { $appToken = "" Message($token) { $this.appToken = $token } send([array]$uids…
|
537
|
|
60 字
|
2 分钟
HeidiSQL 导出密码解密
https://www.fournoas.com/posts/how-to-recover-a-stored-password-from-heidisql/ function Decrypt { param( [string]$str ) if ([string]::IsNullOrEmpty($str)) { return ""…
|
644
|
|
61 字
|
3 分钟
pwsh 对一组 IP 进行排序
# 将 ip 转为 int 值 function Convert-IPv4ToInt { param ( [string]$ipAddr ) $ip = $ipAddr.Split(':')[0] $ipAddress = [System.Net.IPAddress]::Parse($ip) # 获取小端序整数 $littleE…
|
654
|
|
28 字
|
2 分钟
pwsh 处理 yaml 文件
$ErrorActionPreference = 'Stop' $ipText = @" 10.10.103.31 10.10.103.61 "@ [string[]]$ipArry = $ipText.Split([char[]]"`r`n") | % { $_.Trim() } | ?…
|
665
|
|
103 字
|
6 分钟
pwsh 使用 RunspacePool 进行并发操作
# 创建运行空间池 $runspacePool = [RunspaceFactory]::CreateRunspacePool(1, 100) # 创建运行空间池 最大 100 个 $runspacePool.Open() $fakeIdDcit = @{} $fakeIdDcit["9D370B71F76FC2"] = 1 $…
|
772
|
|
109 字
|
6 分钟