久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

構建后事件執行 PowerShell

Post build event execute PowerShell(構建后事件執行 PowerShell)
本文介紹了構建后事件執行 PowerShell的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

是否可以使用構建后事件設置 .NET 項目來執行 powershell 腳本?我正在使用這個腳本來生成一些文件.

Is it possible to set up a .NET project with a post build event to execute a powershell script? I am using this script to generate some files.

我還可以將它是調試版本還是發布版本傳遞給腳本.一個很好的例子.

Also can I pass whether it's a debug or release build to script. An example of this would be great.

推薦答案

這里是一個例子:

首先:您必須意識到必須配置 PowerShell 才能執行腳本.以下行允許 PowerShell 執行腳本:

First of all : you must be aware of the fact that PowerShell must be configure to execute scripts. The following line allow PowerShell to execute scripts :

Set-ExecutionPolicy RemoteSigned

此處特別提及:如果您運行的是 64 位系統,則必須注意 'devenv.exe' Visual Studio 2010 可執行文件是一個 32Bits 的 exe,所以你需要允許 PowerShell 32 執行腳本.

Special mention here : if you are running a 64bits system you've got to take care of the fact that 'devenv.exe' the Visual Studio 2010 executable is a 32Bits exe, so you need to allow PowerShell 32 to execute scripts.

在這里,您可以進入您的項目屬性并配置后期構建,如下所示(對不起,法語):

Once here you can go in your project properties and configure post build as shown here under (sorry in french) :

例如:

這里是文件'psbuild.ps1',它在目標路徑中創建一個'test.txt',里面有配置名稱.我評論了不同的方式來調試你的 postbuild 腳本(消息框、聲音、輸出消息)

Here is the file 'psbuild.ps1', it creates a 'test.txt' in the target path with the configuration name inside. I put in comment different ways to debug your postbuild script (message box, sound, message on the output)

param ([string]$config, [string]$target)

#[void][Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
#[void][System.Windows.Forms.MessageBox]::Show("It works.")
#[Console]::Beep(600, 800)
#Write-Host 'coucou'
set-content $target -Value $config -Force

這篇關于構建后事件執行 PowerShell的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Is there a way to know if someone has bookmarked your website?(有沒有辦法知道是否有人為您的網站添加了書簽?)
Use of Different .Net Languages?(使用不同的 .Net 語言?)
Is there a C# library that will perform the Excel NORMINV function?(是否有執行 Excel NORMINV 函數的 C# 庫?)
Determining an #39;active#39; user count of an ASP.NET site(確定 ASP.NET 站點的“活動用戶數)
Select x random elements from a weighted list in C# (without replacement)(從 C# 中的加權列表中選擇 x 個隨機元素(無需替換))
Best way to keep track of current online users(跟蹤當前在線用戶的最佳方式)
主站蜘蛛池模板: 久久精品色欧美aⅴ一区二区 | 亚洲一区二区 | 免费午夜视频在线观看 | 色婷婷综合久久久久中文一区二区 | 97精品国产97久久久久久免费 | 免费看黄色视屏 | 久久国产精品久久久久久 | 欧美一级视频免费看 | 97在线观视频免费观看 | 一级国产精品一级国产精品片 | 色狠狠桃花综合 | 国产精品美女久久久免费 | 日本久久久一区二区三区 | 国产精品久久欧美久久一区 | 国产成人短视频在线观看 | 色婷婷久久久久swag精品 | 日韩欧美视频 | 大学生a级毛片免费视频 | 中文字幕一区二区三区四区不卡 | 成年免费大片黄在线观看一级 | 久久久国产精品入口麻豆 | 亚洲码欧美码一区二区三区 | 精品国产一区二区国模嫣然 | 无毛av| 精品福利一区 | 欧美中文在线 | 91麻豆久久久| 中文字幕免费观看 | 久久久久国产一区二区三区 | 一级毛片在线看 | 国产成人精品久久二区二区91 | 一级特黄在线 | 99精品在线观看 | 日韩福利片 | 91天堂网 | 在线黄色影院 | 欧美不卡网站 | 国产一区二区精华 | 九九久久国产 | 国产精品久久久久久婷婷天堂 | 第一色在线 |