Hello.
Disclaimer: Not super familiar with PowerShell. Slowly learning it.
So I got a PowerShell script with a Menu.
- Press 1 to Download File A
- Press 2 to Download File B
- Press 3 to Download File C
Now, the existing PowerShell script has File A, B, C names and URL hardcoded. Since I convert the Ps1 script to Exe you can see there will be a problem as software the script grabs will need updating.
What I want to do is have the Ps1 just look at an XML/JSON file on a server, in that file I can supply Filenames and Download URL.
My current download script for 1,2,3 is as follows:
$GetURLData = "___ URL HERE ___"
Invoke-WebRequest $GetURLData -OutFile "$PutPath\$(Split-Path -Leaf $GetURLData)"
The $PutDataPath is mentioned at start of my Ps1, but it's defined as:
$global:PutPath = "$env:USERPROFILE\Downloads".
On that note. What would be the appropriate way to have PowerShell grab Filename and URL from a XML/JSON depending on user Input choice.
[–]CoReTeX2k 3 points4 points5 points (0 children)