psake

Spaced paths, msbuild, and psake

和自甴很熟 提交于 2020-01-15 11:54:16
问题 Related question here. This works properly for compiling an mvc3 application. task Compile { $config = $script:siteConfig.config exec { & "C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe" $webproject_path ` /p:Configuration=$config /p:WebProjectOutputDir="$publish_dir" ` /p:Outdir="$out_dir" /p:CleanWebProjectOutputDir=False ` /T:_WPPCopyWebApplication /T:ResolveReferences /verbosity:quiet /nologo } } All of those path variables are script properties. However, when spaces are

Spaced paths, msbuild, and psake

瘦欲@ 提交于 2020-01-15 11:54:13
问题 Related question here. This works properly for compiling an mvc3 application. task Compile { $config = $script:siteConfig.config exec { & "C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe" $webproject_path ` /p:Configuration=$config /p:WebProjectOutputDir="$publish_dir" ` /p:Outdir="$out_dir" /p:CleanWebProjectOutputDir=False ` /T:_WPPCopyWebApplication /T:ResolveReferences /verbosity:quiet /nologo } } All of those path variables are script properties. However, when spaces are

What is up with this PowerShell command line quoting/escaping?

人盡茶涼 提交于 2020-01-01 04:25:08
问题 I obviously don't know what I'm doing. I have finally got this PowerShell command to work. But I can't figure out why it works. My concern is the final "" characters: &"C:\Program Files\IIS\Microsoft Web Deploy\msdeploy.exe" ` -verb:sync ` -source:contentPath="$build_directory\deploy" ` -dest:contentPath="$server_temp_directory,computerName=$server,username=$server_username,password=$server_password" ` -verbose ` -postSync=runCommand="powershell -NoLogo -NoProfile -Command $server_temp

Create new absolute path from absolute path + relative or absolute path

╄→гoц情女王★ 提交于 2019-12-13 00:48:25
问题 I am working on a build script using psake and I need to create an absolute path from the current working directory with an inputted path which could either be a relative or absolute path. Suppose the current location is C:\MyProject\Build $outputDirectory = Get-Location | Join-Path -ChildPath ".\output" Gives C:\MyProject\Build\.\output , which isn't terrible, but I would like without the .\ . I can solve that issue by using Path.GetFullPath . The problem arises when I want to be able to

How to create dynamic build tasks with Invoke-Build in PowerShell

三世轮回 提交于 2019-12-11 00:08:45
问题 Using Invoke-Build I am trying to create dynamic build tasks, an example of the approach is below. Where, in a similar fashion to the classic UNIX make facility an output file will be generated for each input file iff the input file is newer than the output file. It accomplishes this by dynamically generating a set of incremental tasks and then calling the tasks. The generation of the incremental tasks is outlined below: $Jobs = Foreach($_ in $Conf ) { $SourceFile = Get-Item $_ $FileName =

PowerShell 2.0 - Running scripts for the command line call vs. from the ISE

天大地大妈咪最大 提交于 2019-12-03 13:55:52
问题 After writing deployment scripts from within the ISE, we need our continuous integration (CI) server to be able to run them automatically, i.e. from the command line or via a batch file. I have noticed some significant differences between the following calls: powershell.exe -File Script.ps1 powershell.exe -Command "& '.\Script.ps1'" powershell.exe .\Script.ps1 Some simple examples: When using -File , errors are handled in the exact same way as the ISE. The other two calls seem to ignore the

How to run Code-First Migrations from a psake build?

半腔热情 提交于 2019-11-30 14:14:24
问题 I can type Update-Database , Enable-Migrations etc, from Package Manager Console and it works fine. If I need to do the same from a regular powershell session, or in a psake build file, then how do I do it? I tried importing the module EntityFramework.5.0.0\tools\EntityFramework.psm1 from the packages directory, and I did get the Update-Database , Enable-Migrations functions, but I cannot supply their arguments - they need a project, source, and 6 more - and there is no documentation

How to run Code-First Migrations from a psake build?

一曲冷凌霜 提交于 2019-11-30 09:58:12
I can type Update-Database , Enable-Migrations etc, from Package Manager Console and it works fine. If I need to do the same from a regular powershell session, or in a psake build file, then how do I do it? I tried importing the module EntityFramework.5.0.0\tools\EntityFramework.psm1 from the packages directory, and I did get the Update-Database , Enable-Migrations functions, but I cannot supply their arguments - they need a project, source, and 6 more - and there is no documentation whatsoever. Can I not automate the database deploy on some machine in our CI chain ? Keith Hill The problem

Strange behavior with Powershell scriptblock variable scope and modules, any suggestions?

笑着哭i 提交于 2019-11-28 07:35:06
NOTE: I'm using PowerShell 2.0 on Windows Vista. I'm trying to add support for specifying build arguments to psake , but I've run into some strange PowerShell variable scoping behavior dealing specifically with calling functions that have been exported using Export-ModuleMember (which is how psake exposes it's main method). Following is a simple PowerShell module to illustrate (named repoCase.psm1): function Test { param( [Parameter(Position=0,Mandatory=0)] [scriptblock]$properties = {} ) $defaults = {$message = "Hello, world!"} Write-Host "Before running defaults, message is: $message" .

Strange behavior with Powershell scriptblock variable scope and modules, any suggestions?

て烟熏妆下的殇ゞ 提交于 2019-11-27 01:52:08
问题 NOTE: I'm using PowerShell 2.0 on Windows Vista. I'm trying to add support for specifying build arguments to psake, but I've run into some strange PowerShell variable scoping behavior dealing specifically with calling functions that have been exported using Export-ModuleMember (which is how psake exposes it's main method). Following is a simple PowerShell module to illustrate (named repoCase.psm1): function Test { param( [Parameter(Position=0,Mandatory=0)] [scriptblock]$properties = {} )