This project is read-only.


No variables are set when invoking of Powershell Script (NuGetter (A) - Prepackaging)


I used the PowerShell example of NuGetter User and Developement Guide.
But it seems that all variables are null or empty (tfsDropFolder, tfsNuGetPrePackageFolder, ...).
$logFile = "C:\MyLog.txt"
function Write-Log ([string] $message)
Add-Content -Path $logFile -Value $message

Calculate where the files will be copied for the NuGet Packaging process

if ([IO.Path]::IsPathRooted($nuGetPackageSourceFolder))
Write-Log "IsRooted"
$nugetPrePackageFolder = $tfsNuGetPrePackageFolder
Write-Log "Is not rooted"
Write-Log "tfsDropFolder: " + $tfsDropFolder
Write-Log "tfsNuGetPrePackageFolder: " + $tfsNuGetPrePackageFolder
$nugetPrePackageFolder = Join-Path $tfsDropFolder $tfsNuGetPrePackageFolder
Write-Log "nugetPrePackageFolder: " + $nugetPrePackageFolder
In my log I see that the variables are not set.
But when I look into the TFS View Log.
Every variable (powerShellScriptFilepath, dropFolder, binariesFolder, sourcesFolder) is set correctly.
In the Activities Assermbly I can see that those variables should been set.
    runspace.SessionStateProxy.SetVariable("tfsDropFolder", (object) dropFolder);
    runspace.SessionStateProxy.SetVariable("tfsSourcesFolder", (object) sourcesFolder);
    runspace.SessionStateProxy.SetVariable("tfsBinariesFolder", (object) binariesFolder);
    runspace.SessionStateProxy.SetVariable("tfsNuGetPrePackageFolder", (object) nuGetPrePackageFolder);
What did I wrong?
Closed Oct 6, 2011 at 10:23 PM by marknic


Rookian wrote Oct 6, 2011 at 2:02 PM

can be closed. I have to call: Write-Log "tfsDropFolder: $tfsDropFolder"

marknic wrote Oct 6, 2011 at 10:14 PM


Thanks for following up. Closing this one.


wrote Oct 6, 2011 at 10:23 PM

wrote Feb 22, 2013 at 12:00 AM

wrote May 16, 2013 at 11:39 AM