Using Rest Api From Powershell If Statement