外观
PowerShell
执行策略
允许脚本执行
ps1
Set-ExecutionPolicy RemoteSigned关闭/开启 IPV6
注意
保存为脚本文件时, 如有中文需要修改编码保存 ANSI GB2312 GBK GB18030 以管理员身份运行
ps1
Get-NetAdapterBinding -ComponentID ms_tcpip6ps1
Disable-NetAdapterBinding -Name "以太网" -ComponentID ms_tcpip6ps1
Enable-NetAdapterBinding -Name "以太网" -ComponentID ms_tcpip6更改网络类型 (专用/公用)
ps1
Get-NetConnectionProfileps1
Set-NetConnectionProfile -Name "网络" -NetworkCategory Privateps1
Set-NetConnectionProfile -Name "网络" -NetworkCategory Public剪切板保存到文件
ps1
Get-Clipboard > name.txt关闭显示器
bat
@echo off
echo turn off in 3
timeout /t 1 /nobreak >nul
echo 2
timeout /t 1 /nobreak >nul
echo 1
timeout /t 1 /nobreak >nul
powershell -command "Add-Type -TypeDefinition 'using System;using System.Runtime.InteropServices;public class Sleep{[DllImport(\"user32.dll\")]public static extern int SendMessage(int hWnd,int hMsg,int wParam,int lParam);}' ; [Sleep]::SendMessage(-1,0x0112,0xF170,2)"
exit