This removes a web application and leaves the content database. This is also an example of PowerShell Transcripts for recording powershell actions.
start-transcript c:\temp\trans.txt -noclobber -append
Remove-SPWebApplication https://xxx -Confirm -DeleteIISSite -whatif
stop-transcript