powershell代码 设置网络配置为私人 启用设备的自动设置 将网络配置设置为公共 禁用设备的自动设置 启用文件和打印机共享 启用密码保护共享 禁用文件和打印机共享 禁用密码保护共享 启用网络发现 启用40/56位加密文件共享 禁用网络发现 启用128位加密文件共享

设置网络配置为私人 启用设备的自动设置 将网络配置设置为公共 禁用设备的自动设置 启用文件和打印机共享 启用密码保护共享 禁用文件和打印机共享 禁用密码保护共享 启用网络发现 启用40/56位加密文件共享 禁用网络发现 启用128位加密文件共享

powershellCopy Code
# 设置网络配置为私人
Set-NetConnectionProfile -InterfaceAlias "Ethernet" -NetworkCategory Private

# 启用设备的自动设置
Set-NetIPInterface -InterfaceAlias "Ethernet" -AutomaticPrivateIPAddressAssignment Enabled

# 将网络配置设置为公共
Set-NetConnectionProfile -InterfaceAlias "Ethernet" -NetworkCategory Public

# 禁用设备的自动设置
Set-NetIPInterface -InterfaceAlias "Ethernet" -AutomaticPrivateIPAddressAssignment Disabled

# 启用文件和打印机共享
Set-NetFirewallRule -DisplayGroup "File and Printer Sharing" -Enabled True

# 启用密码保护共享
Set-SmbServerConfiguration -EnableSMB1Protocol $false

# 禁用文件和打印机共享
Set-NetFirewallRule -DisplayGroup "File and Printer Sharing" -Enabled False

# 禁用密码保护共享
Set-SmbServerConfiguration -EnableSMB1Protocol $true

# 启用网络发现
Set-NetFirewallRule -DisplayGroup "Network Discovery" -Enabled True

# 启用40/56位加密文件共享
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" -Name "RequireSecuritySignature" -Value 0

# 禁用网络发现
Set-NetFirewallRule -DisplayGroup "Network Discovery" -Enabled False

# 启用128位加密文件共享
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" -Name "RequireSecuritySignature" -Value 1

视觉,最佳性能与流畅的FC,禁用透明效果,暗色模式,应用程序暗色模式,Windows暗色模式

 
 
  1. 最佳性能和流畅度:
powershellCopy Code
# 设置性能选项为最佳性能
$performanceOptions = Get-WmiObject -Class Win32_SystemPerformance -Namespace "root\CIMV2" | Select-Object -ExpandProperty CurrentOptimization
Set-CimInstance -Query "SELECT * FROM Win32_SystemPerformance" -Namespace "root\CIMV2" -Property @{CurrentOptimization='BestPerformance'}
  1. 禁用透明效果:
powershellCopy Code
# 禁用窗口透明效果
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize" -Name "EnableTransparency" -Value 0
  1. 暗色模式应用程序:
powershellCopy Code
# 启用暗色模式应用程序
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize" -Name "AppsUseLightTheme" -Value 0
  1. 暗色模式Windows:
powershellCopy Code
# 启用暗色模式Windows
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize" -Name "SystemUsesLightTheme" -Value 0

界面,将“此电脑”图标添加到桌面,将“用户文件”添加到桌面,将“网络”添加到桌面,强制在控制面板中显示图标视图,显示文件扩展名,启用缩略图预览,在通知区域显示所有图标,从任务栏中移除“人物”,禁用广告建议,禁用应用程序建议,禁用推荐应用程序的安装。

 
 
  1. 将“此电脑”图标添加到桌面:
powershellCopy Code
# 创建“此电脑”快捷方式并添加到桌面
$shell = New-Object -ComObject WScript.Shell
$shortcut = $shell.CreateShortcut("$home\Desktop\This PC.lnk")
$shortcut.TargetPath = [System.Environment]::GetFolderPath('MyComputer')
$shortcut.Save()
  1. 将“用户文件”添加到桌面:
powershellCopy Code
# 创建“用户文件”快捷方式并添加到桌面
$shell = New-Object -ComObject WScript.Shell
$shortcut = $shell.CreateShortcut("$home\Desktop\User Files.lnk")
$shortcut.TargetPath = [System.Environment]::GetFolderPath('UserProfile')
$shortcut.Save()
  1. 将“网络”添加到桌面:
powershellCopy Code
# 创建“网络”快捷方式并添加到桌面
$shell = New-Object -ComObject WScript.Shell
$shortcut = $shell.CreateShortcut("$home\Desktop\Network.lnk")
$shortcut.TargetPath = "\\"
$shortcut.Save()
  1. 控制面板中强制显示图标视图:
powershellCopy Code
# 强制在控制面板中显示图标视图
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" -Name "AllItemsIconView" -Value 1
  1. 显示文件扩展名:
powershellCopy Code
# 显示文件扩展名
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "HideFileExt" -Value 0
  1. 启用缩略图预览:
powershellCopy Code
# 启用缩略图预览
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ThumbnailPreviewsEnabled" -Value 1
  1. 在通知区域显示所有图标:
powershellCopy Code
# 在通知区域显示所有图标
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer" -Name "EnableAutoTray" -Value 1
  1. 从任务栏中移除“人物”:
powershellCopy Code
# 从任务栏中移除“人物”
(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced")["PeopleBand"] = 0

 

posted @ 2024-02-21 05:09  suv789  阅读(31)  评论(0编辑  收藏  举报