Hello,
I try to use this script :
$command = invoke-command -computername auditad1 -scriptblock {dcdiag.exe}
#regex for french language
$regex = [regex]"(?sm)\.+\sLe\stest\s(\w+).+?de\s([A-Za-z0-9_-]+)\sa\s(r.ussi|.chou.)"
$allmatches = $regex.Matches($command)
Foreach($line in $allmatches){
[PSCustomObject]@{
TestName = $line.Groups[1].Value
TestResult = $line.Groups[3].Value
}
}
The result in ISE powershell is not what I would like (should be réussi and échoué on test result column) :
The result in powershell console if I execute the ps1 file is :
If I execute directly dcdiag on powershell ISE, there are also issue with "," character.
However, if I execute dcdiag in powershell console, result is ok and I have accent and not ",".
What I need to do to execute this command on remote system and not having this issue ?