function install_msi($url) { $telemetry = @{ DisplayName = "Telemetry Service"; filename = "TelemetryServiceInstaller_x64.msi" Url = $url } Write-Host $telemetry.Url Write-Host 'Install TelemetryService' Start-BitsTransfer $telemetry.Url "$env:temp$filename" $destination = "$env:temp" msiexec /i "$destinationTelemetryServiceInstaller_x64.msi" /norestart INSTALLSERVICE=1 /QUIET |out-null Write-Host "TelemetryService installed success!" } $url = "\10.63.32.243ShareTelemetryMaster Build113Releasex64TelemetryServiceInstaller_x64.msi" install_msi $url
function unstall_msi($url) { $telemetry = @{ DisplayName = "Telemetry Service"; filename = "TelemetryServiceInstaller_x64.msi" Url = $url } Write-Host $telemetry.Url Write-Host 'Unstall TelemetryService' Start-BitsTransfer $telemetry.Url "$env:temp$filename" $destination = "$env:temp" msiexec /uninstall "$destinationTelemetryServiceInstaller_x64.msi" /norestart INSTALLSERVICE=1 /QUIET |out-null Write-Host "TelemetryService unstalled success!" } $url = "\10.63.32.243ShareTelemetryMaster Build113Releasex64TelemetryServiceInstaller_x64.msi" unstall_msi $url