Using PowerShell Studio… I’ve created a form that pulls warranty info from Dell’s website. The click event runs the following…
$apikey = "(redacted)" $serial = $textboxSerialNumber.Text [xml]$XML = (Invoke-WebRequest -Uri "https://api.dell.com/support/v2/assetinfo/warranty/tags.xml?apikey=$apikey&svctags=$serial") $datetimepickerPurchaseDate.Text = Get-Date $XML.GetAssetWarrantyResponse.GetAssetWarrantyResult.Response.DellAsset.ShipDate -Format d
If I run it as a PSF from PowerShell studio if returns the date. If I build it and run it as an EXE I get the following error.
Invoke-WebRequest : Unable to connect to the remote server At line:292 char:18 + ... xml]$XML = (Invoke-WebRequest -Uri "https://api.dell.com/support/v2/a ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:Htt pWebRequest) [Invoke-WebRequest], WebException + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShe ll.Commands.InvokeWebRequestCommandAny ideas?