# Define the URL of the ZIP file $zipUrl = "https://new.anvil.nz/RoomSetupTool.zip" # Define the destination path for the ZIP file $destinationDir = "C:\temp\MTR" $destinationPath = "$destinationDir\RoomSetupTool.zip" # Define the extraction path $extractPath = "C:\temp\MTR\RoomSetupTool" # Create the destination directory if it doesn't exist if (-Not (Test-Path -Path $destinationDir)) { New-Item -ItemType Directory -Path $destinationDir } # Download the ZIP file Invoke-RestMethod -Uri $zipUrl -OutFile $destinationPath # Create the extraction directory if it doesn't exist if (-Not (Test-Path -Path $extractPath)) { New-Item -ItemType Directory -Path $extractPath } # Extract the ZIP file Add-Type -AssemblyName System.IO.Compression.FileSystem [System.IO.Compression.ZipFile]::ExtractToDirectory($destinationPath, $extractPath) # Clean up the ZIP file Remove-Item -Path $destinationPath Write-Host "Downloaded and extracted to $extractPath" Start-Process "$extractPath\MeetingRoomSetup.cmd" -Wait # Clean up the extracted files and directory Remove-Item -Path $extractPath -Recurse -Force Remove-Item -Path $destinationDir -Recurse -Force Write-Host "Cleanup completed"