I have the following code, but I need to extract the “return code” string as well as whatever numerical value is there, for instance a “0”, or a 1", etc.
I have no idea how to do this.
Here is what I have so far and it works great, but I just want to extract “return code 0”, or “return code 1”.
$SCCMClntReturnCode = @(
Get-Content -Path "C:\Windows\ccmsetup\Logs\ccmsetup.log" |
Select-Object -Last 1
)
Here is the actual string that I would like to extract from:
![LOG[CcmSetup is exiting with return code 0]LOG]!><time="05:09:58.184+420" da te="10-19-2015" component="ccmsetup" context="" type="1" thread="7776" file="cc msetup.cpp:10879"
Thank you all for your help.