Clear-Host $person = @{ "username"="root" "password"="lepassword" } $json = $person | ConvertTo-Json $Result = Invoke-RestMethod http://ipduserveur/api/login -Method Post -Body $json -ContentType 'application/json' $Result | gm $tokenautiliser = $Result.auth_token write-host $tokenautiliser