我有这个代码生成以下输出:
$String = "shutdown.exe -r -f"
$Data = schtasks /query /v /fo LIST | Select-String $String -Context 7 -SimpleMatch | Out-File "C:\Users\user\Desktop\String.txt"
$Testy = 'C:\Users\user\Desktop\String.txt'
Get-Content $Testy | select-string 'TaskName' -SimpleMatch -OutVariable $Taskname
Write-Host $Taskname
Output= TaskName: \FWI Reboot
我需要找到一种方法来隔离FWI Reboot
。我怎么能这样做?