In an attempt to utilize PowerShell to automate a process of pulling down files, doing something with them, and then copying them to somewhere else, I have most of the process working. My only issue I am encountering is I cannot get invoke webrequest to download multiple files.
# Specify variables
$SVN_BASE = "website ommitted"
$SCCM_PATH = "path omitted"
$LOKI_PATH = "path omitted"
$INSTALLER_NAME = "Firefox Setup 58.0.1.exe"
$PROJECT_FOLDER = "mozilla_firefox_rr"
# Set an alias for the executable 7zip to be called to extract files
set-alias 7z "$env:ProgramFiles\7-Zip\7z.exe"
# Create the working directory for the application
new-item -path "$($env:userprofile)\Desktop" -name $PROJECT_FOLDER -itemtype
directory -Force
# Change the directory to the working directory
set-location "$($env:userprofile)\Desktop\$PROJECT_FOLDER"
# Invoke-WebRequest is aka wget. Here, we are downloading the required file
# and placing it into our working directory
Invoke-WebRequest "$SVN_BASE" -outfile ".\"
Invoke-WebRequest "$LOKI_PATH/$INSTALLER_NAME" -outfile
"$($env:userprofile)\Desktop\$PROJECT_FOLDER\$INSTALLER_NAME"
# Extract contents of executable
7z x Firefox*.exe
# Remove contents that aren't needed
Remove-item .\$INSTALLER_NAME
Remove-item "$SCCM_PATH\core" -recurse
Remove-item "$SCCM_PATH\setup.exe" -recurse
# The final step is copying the newly extracted files to the corresponding SCCM directory
copy-item ".\*" -Destination $SCCM_PATH -recurse
The line that I am hoping to utilize to do this is
Invoke-WebRequest "$SVN_BASE" -outfile ".\"
Any suggestions?
Thanks