powershell - 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?
解决方案
推荐阅读
- javascript - 接收来自 .post 的响应时出现问题
- assembly - 了解 x86 idivl 指令
- angular - 如何在使用反应形式不接触Angular中的输入字段后触发异步验证器?
- scala - 错误:对象 Stemmer 不是包 org.apache.spark.mllib.feature 的成员
- vba - MS Access - 获取子表单的当前查询名称
- reactjs - 从 JSON react-native 获取特定对象
- javascript - 在 Vue JS 中获取数据属性作为对象:即使使用 JSON.stringify 也返回 [object object]
- c# - 用户定义类型中不支持的列数据类型
- ios - 表视图在首次启动 Swift 时未显示来自领域数据库的数据
- reporting-services - SSRS 报告描述字符限制