Remove a Web Application
Scenario/Problem: You need to remove a web application from the current server configuration.
Solution: Use the Remove-SPWebApplication
cmdlet with a web application variable.
The Remove-SPWebApplication
cmdlet enables you to remove a specific web application from the current server. Use this in conjunction with the Get-SPWebApplication
cmdlet (explained in a previous section), as shown in Listing 5.3, or just use the web application identity directly in line, as shown in Listing 5.4.
$webApp = Get-SPWebApplication -Identity "PSWebApp"Remove-SPWebApplication $webApp
Remove-SPWebApplication -Identity ...
Get PowerShell™ for SharePoint® 2013 How-To now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.