我需要帮助来排序后,在消息框的卷$_.mountpoint输出。
if ((Get-Tpm).TPMReady -eq $true){
$tpminfo = Get-WmiObject -class Win32_Tpm -namespace root\CIMV2\Security\MicrosoftTpm
[string]$tpmversion = $tpminfo.PhysicalPresenceVersionInfo
[System.Windows.MessageBox]::Show( "TPM Enabled "+$lf+ $lf + "VOLUMES: $lf"+ `
(Get-BitLockerVolume |select-object mountpoint,VolumeStatus| `
ForEach-Object {$lf,$_.MountPoint, $_.VolumeStatus}))
} else {
[System.Windows.MessageBox]::Show( "TPM DISABLED "+$lf+ $lf + "VOLUMES: $lf"+ `
(Get-BitLockerVolume |select-object mountpoint,VolumeStatus| `
ForEach-Object {$lf,$_.MountPoint, $_.VolumeStatus}))
EXIT
}谢谢马蒂亚斯
发布于 2019-02-01 02:09:21
请尝试使用以下方式插入换行符:
[System.Windows.MessageBox]::Show( "TPM Enabled: $thing`r`nVolumes:$thing")所以,在你的脚本中,我会这样做(未测试):
[System.Windows.MessageBox]::Show( "TPM DISABLED`r`n`r`nVOLUMES: `r`n" +`
(Get-BitLockerVolume |select-object mountpoint,VolumeStatus |`
ForEach-Object {"`r`n" + $_.MountPoint + ": " + $_.VolumeStatus}))https://stackoverflow.com/questions/54461112
复制相似问题