久久久久久久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(跟蹤當前在線用戶的最佳方式)
主站蜘蛛池模板: 国产成人99久久亚洲综合精品 | www.99re| av黄色在线 | 成人高清在线视频 | 最新伦理片 | 久久久国产一区二区三区 | 久久久久网站 | 国产在线一 | 国产精品欧美一区二区三区不卡 | av色在线 | 蜜桃视频一区二区三区 | 成人免费在线小视频 | 午夜精品在线观看 | 国产观看| 日韩国产在线 | 中文字幕国产视频 | 日韩精品免费在线观看 | 亚洲成人中文字幕 | 久热精品在线观看视频 | 成人在线视频一区 | 日本成人区 | 羞羞的视频免费在线观看 | 亚洲一区精品视频 | 亚洲精品在线免费观看视频 | 日本中文字幕一区 | 欧美精品在线观看 | 一区二区久久 | 欧美成人精品 | 成人影院一区二区三区 | 日韩视频中文字幕 | 欧美xxxx色视频在线观看免费 | 精品九九久久 | 在线视频一区二区 | 一级特黄色毛片 | 日本中文字幕视频 | 欧美性生交大片免费 | 中文字幕一级毛片视频 | a级免费观看视频 | 午夜天堂精品久久久久 | 99久久99 | 国产一区二区精品自拍 |