分类: powershell

23 篇文章

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 ""…
pwsh 对一组 IP 进行排序
# 将 ip 转为 int 值 function Convert-IPv4ToInt { param ( [string]$ipAddr ) $ip = $ipAddr.Split(':')[0] $ipAddress = [System.Net.IPAddress]::Parse($ip) # 获取小端序整数 $littleE…
pwsh 处理 yaml 文件
$ErrorActionPreference = 'Stop' $ipText = @" 10.10.103.31 10.10.103.61 "@ [string[]]$ipArry = $ipText.Split([char[]]"`r`n") | % { $_.Trim() } | ?…
pwsh 使用 RunspacePool 进行并发操作
# 创建运行空间池 $runspacePool = [RunspaceFactory]::CreateRunspacePool(1, 100) # 创建运行空间池 最大 100 个 $runspacePool.Open() $fakeIdDcit = @{} $fakeIdDcit["9D370B71F76FC2"] = 1 $…
pwsh windows 检测代理IP
$ipTxt = @" 1.1.1.1 2.2.2.2 3.3.3.3 "@ # 将 ip 文本拆分为数组 [string[]]$ips = $ipTxt.Split([char[]]"`r`n") | % { $_.Trim() } | ? { $_.Length -gt 0 } 0..19 | % { #…
判断当前设备是否在线有网址
除了 ping baidu.com - http://www.gstatic.com/generate_204 288 - http://connectivitycheck.gstatic.com/generate_204 153 - http://captive.apple.com/ 146 - http://www.msftconnecttes…
批量转换 epub 至 mobi 文件
# 下载 Calibre , 找到 ebook-convert.exe $app = ".\ebook-convert.exe" # ebook-convert.exe 路径 $root = ".\epub\" # 电子书路径 Get-ChildItem "$root\*.epub" | …