首页 > 解决方案 > Windows Powershell needs to print out information for a particular command regardless of whether it successfully executed or Not

问题描述

I'm king of novice when it comes to Powershell. I wanted to create Powershell scripts that are more verbose as it executes various commands.

For example in the following code, I want it to clearly display what it doing, and regardless of whether the command was executed successfully Or Not, I want it to print out the results of the execution of the command in question:

Import-Module IISAdministration

Stop-WebSite 'ArtemisDEV'

$a = ".\blabBlah.csproj /t:Clean" Invoke-Expression "$msbuild $a"

$b = ".\blabBlah.csproj /t:Build /p:Configuration=Dev" Invoke-Expression "$msbuild $b"

Could someone please modify the aforementioned code, and show it such a way that it will print out more verbose output statements?

标签: powershelliismsbuildwindows-10trace

解决方案


推荐阅读