Dear Madam/Sir,
I created a GPO to place a file on all users' desktop, I want to collect the result and find out who is failed to apply the GPO (By detect the files exists).
I use "When a HTTP request is received" as trigger, then created a Powershell file use invoke-webrequest to trigger the flow and send parameter - username,hostname,date,time,and file exists.
Please see the code in PS1 file
$fileexists=test-Path -Path "C:\Users\$env:username\OneDrive - INABATA CO., LTD\デスクトップ\Shorcut_creation.ps1" -PathType Leaf
$postParams = @{username=hostname;hostname=whoami;thedate=Get-Date -Format "MM/dd/yyyy";thetime=Get-Date -Format "hh:mm";fileexists=$fileexists}
invoke-webrequest -uri "XXXXXXXXXXXXXXXXXX" -Method POST -Body $postParams
when I run the PS1 file, my flow will receive below JSON in body of the trigger,
I want to parse it and extract the value, in this case they are "CZC1060","False","06/28/2022","china\\zhang.ren","04:44",
I use "parse JSON" as a action ,and use above JSON as sample to generate schema, but it cannot successfully parse the key/value pair.
Would you please advise

Report
All responses (
Answers (