距离下一个情人节还有多少分钟?
我知道距离多少天好算,如果变成分钟呢?
1 2 3 4 5 6 7 8 | $now = Get-Date $day =[datetime] '2-14' if( $now -lt $day ){ $day .Subtract( $now ).TotalMinutes } else{ $day .AddYears(1).Subtract( $now ).TotalMinutes } |
[容量] 3GB > 3145726KB吗
1 2 | PS > 3gb -gt 3145726kb True |
[ID]能产生一个GUID吗?
1 2 3 4 5 | PS > [guid]::NewGuid() Guid ---- 0f283ab4-f402-400c-98ce-359442f11f1a |
[文件] Windows目录下所有可执行文件exe的大小是多少?
1 | dir $env :windir -Filter *.exe | measure -Sum Length |
[注册表] 注册表路径HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework 下 ‘Enable64Bit'的值是多少?
1 | ( Get-ItemProperty -Path hklm:SOFTWARE\Microsoft\.NETFramework ).Enable64Bit |
[证书] 指纹为[28DE15612AFF1CD69596AB17AF06AE86CB9C003B]的证书在证书存储区吗?
1 2 | ls Cert:\LocalMachine\My\ | where { $_.Thumbprint -eq '28DE15612AFF1CD69596AB17AF06AE86CB9C003B' } |
[服务] 打印机服务有没有启动呢?
[进程] 当前运行了多少个IE进程?
1 | ( Get-Process iexplore ).count |
[报表] 将所有运行的进程信息导出为HTML报表?
1 | Get-Process | ConvertTo-Html | Out-File a.html |