I found PS script (below) for downloading ZIP file from ULR and unzipping it in specific file.
$Url = "www.link.com/test.zip"
$DownloadZipFile = "D:\Test" + $(Split-Path -Path $Url -Leaf)
$ExtractPath = "D:\Test"
Invoke-WebRequest -Uri $Url -OutFile $DownloadZipFile
$ExtractShell = New-Object -ComObject Shell.Application
$ExtractFiles = $ExtractShell.Namespace($DownloadZipFile).Items()
$ExtractShell.NameSpace($ExtractPath).CopyHere($ExtractFiles)
Start-Process $ExtractPath
#
This works fine but I have problem if same file already exists in this folder. So, I need to add if file exist to overwrite this file with new file. Can someone can help me?
Rgds, Nejc