# 设置二进制数据到注册表项$value= [byte[]]@(0x01,0x02,0x03,0x04)Set-ItemProperty-Path"HKCU:\Software\MyApp"-Name"BinarySetting"-Value$value-TypeBinary# 获取注册表项中的二进制数据Get-ItemProperty-Path"HKCU:\Software\MyApp"-Name"BinarySetting" 16. 使用 PowerShell 脚本批量管理注册表 编写Powe...
示例3:修改提示函数此命令更改提示函数,以便显示路径之前的时间。PowerShell 复制 Set-Item -Path function:prompt -Value {'PS '+ (Get-Date -Format t) + " " + (Get-Location) + '> '}示例4:设置提示函数的选项此命令设置提示函数的 AllScope 和ReadOnly 选项。此命令使用 的Options 动态参数 ...
若要查看可用值,请运行以下命令: $TimeZone = Get-ChildItem "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Time zones" | foreach {Get-ItemProperty $_.PSPath}; $TimeZone | sort Display | Format-Table -Auto PSChildname,Display。 如果值中有空格,请使用双引号 (") 将此值括起来。 默认值为...
Get-ItemProperty Get-ItemPropertyValue Get-Location Get-Process Get-PSDrive Get-PSProvider Get-Service Get-TimeZone Invoke-Item Join-Path Move-Item Move-ItemProperty New-Item New-ItemProperty New-PSDrive New-Service Pop-Location Push-Location Remove-Item Remove-ItemProperty Remove-PSDrive Remove-Service ...
若要更改注册表值中的名称和数据,请使用 New-ItemProperty、Set-ItemProperty和Rename-ItemProperty cmdlet。 Set-Item 旨在处理任何提供程序公开的数据。若要列出会话中可用的提供程序,请键入 Get-PsProvider。有关详细信息,请参阅 about_Providers。相关链接Clear...
若要查看可用值,请运行以下命令:$TimeZone = Get-ChildItem "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Time zones" | foreach {Get-ItemProperty $_.PSPath}; $TimeZone | sort Display | Format-Table -Auto PSChildname,Display。 如果值中有空格,请使用双引号 (") 将此值括起来。 默认值为 ...