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

構(gòu)建后事件執(zhí)行 PowerShell

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

問題描述

是否可以使用構(gòu)建后事件設(shè)置 .NET 項目來執(zhí)行 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.

我還可以將它是調(diào)試版本還是發(fā)布版本傳遞給腳本.一個很好的例子.

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

推薦答案

這里是一個例子:

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

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 位系統(tǒng),則必須注意 'devenv.exe' Visual Studio 2010 可執(zhí)行文件是一個 32Bits 的 exe,所以你需要允許 PowerShell 32 執(zhí)行腳本.

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.

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

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

例如:

這里是文件'psbuild.ps1',它在目標路徑中創(chuàng)建一個'test.txt',里面有配置名稱.我評論了不同的方式來調(diào)試你的 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

這篇關(guān)于構(gòu)建后事件執(zhí)行 PowerShell的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

相關(guān)文檔推薦

Is there a way to know if someone has bookmarked your website?(有沒有辦法知道是否有人為您的網(wǎng)站添加了書簽?)
Use of Different .Net Languages?(使用不同的 .Net 語言?)
Is there a C# library that will perform the Excel NORMINV function?(是否有執(zhí)行 Excel NORMINV 函數(shù)的 C# 庫?)
Determining an #39;active#39; user count of an ASP.NET site(確定 ASP.NET 站點的“活動用戶數(shù))
Select x random elements from a weighted list in C# (without replacement)(從 C# 中的加權(quán)列表中選擇 x 個隨機元素(無需替換))
Best way to keep track of current online users(跟蹤當(dāng)前在線用戶的最佳方式)
主站蜘蛛池模板: 欧美区日韩区 | 久久久久久久久国产精品 | 欧美午夜精品理论片a级按摩 | 欧美日韩在线一区二区 | 欧美色综合 | 男人天堂视频在线观看 | 成人在线免费视频 | 91精品国产综合久久精品 | 99久久中文字幕三级久久日本 | 国产激情视频在线观看 | 在线看片网站 | 亚洲v区 | 色橹橹欧美在线观看视频高清 | 在线观看亚洲专区 | 天堂视频一区 | 日操操夜操操 | 拍拍无遮挡人做人爱视频免费观看 | 国产精品.xx视频.xxtv | www.4567| 日韩av一区二区在线观看 | 国产成人自拍一区 | 国产精品一区二区av | 免费在线观看成人av | 日韩视频在线观看中文字幕 | 欧美一级在线免费 | 国产精品永久免费视频 | 一区二区三区视频在线观看 | 国产精品久久久久久久久久久久久 | 欧美视频三区 | 91精品国产综合久久久久 | 精品国产18久久久久久二百 | 颜色网站在线观看 | 狠狠操天天操 | 爱爱免费视频 | 亚洲精品乱码久久久久久久久 | 国产精品三级 | 日韩国产一区二区三区 | 成人欧美一区二区三区在线播放 | 欧美精品一区三区 | 天堂av免费观看 | 久久国|