8. PowerShell 用作日历计算
计算多少天到新年:
| PS> ([DateTime]"1/1/2007" -[datetime]::now).days |
Windows Vista有许多类型的事件记录和组策略文件等.下列命令是返回当前目录及其子目录中VBScript, Bat 和 PowerShell 脚本的数量:
| PS> dir -include *.vbs, *.ps1, *.bat -recurse group-object extension -noelement |
10. 从命令行收集Windows System Assessment Tool数据
| PS> get-wmiobject win32_winsat format-table __SERVER, *SCORE -autosize PS> get-wmiobject win32_winsat select *score out-chart -Title "System Assessment Scores by PowerGadgets" |
| PS> set-itemproperty -path HKLM:SOFTWAREMICROSOFTWINDOWSCurrentVersionPoliciesSystem -name ConsentPromptBehaviorAdmin -value 0 |
| PS > $drives = get-wmiobject -namespace rootCIMv2SecurityMicrosoftVolumeEncryption -class Win32_EncryptableVolume PS> $drives format-table DriveLetter, PersistentVolumeID -autosize PS> $BitLockDrive = $drives[0] PS> $BitLockDrive.GetProtectionStatus() PS> $BitLockDrive.DisableKeyProtectors() PS> $BitLockDrive.EnableKeyProtectors() |
更多内容请看PCdog.com--Windows操作系统安装 Windows常见故障排除 Windows远程桌面的应用专题
