Extension/Uninstall-WebApp.ps1
<#
.EXAMPLE .\Uninstall-WebApp.ps1 -SqlServerName localhost -SqlAuthenticationType SQL -SqlUserName sa -AppPoolUserName domain\admin #> [CmdletBinding()] param ( [Parameter()] [string]$InstallerPath = (Join-Path $PSScriptRoot "\incadea.WebApp.Installer.exe"), [Parameter()] [string]$LogPath = "C:\Logs\incadea_Web_Application_Suite_$(Get-Date -Format yyyyMMddHHmmss).txt" ) begin { function Get-ArgString { "/Uninstall" } Write-Host "=========================================================================================" Write-Host ("WebApp-Installer script starting at " + (Get-Date).ToLongTimeString() + "...") Write-Host "=========================================================================================" } process { $ArgString = Get-ArgString Write-Verbose "Start-Process -FilePath $InstallerPath -Wait -ArgumentList ""/Silent $ArgString PowerShellHost -l $LogPath""" Start-Process -FilePath $InstallerPath -Wait -ArgumentList "/Silent $ArgString PowerShellHost -l $LogPath" } end { Write-Host "=========================================================================================" Write-Host ("WebApp-Installer Script finished at " + (Get-Date).ToLongTimeString() + ".") Write-Host ("Please check logs in '$LogPath' folder for more details.") Write-Host "=========================================================================================" } |