Created
December 18, 2015 11:54
-
-
Save trondhindenes/75c7f7f6674fdd685785 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Module PowerShellGet | |
#File PSModule.psm1 | |
#Bug causes publish-module to fail if user has a profile with spaces in it ("C:\users\sam smith") | |
#Replace line 6817 with the following: | |
Microsoft.PowerShell.Management\Start-Process -FilePath "$script:NuGetExePath" ` | |
-ArgumentList ('push "' + $NupkgPath + '"' + " -source $Destination -NonInteractive -ApiKey $NugetApiKey") ` | |
-RedirectStandardError $tempErrorFile ` | |
-RedirectStandardOutput $tempOutputFile ` | |
-NoNewWindow ` | |
-Wait |
I had to push and update in the shortest amount of time possible, so I just tweakted it in the debugger so that it would go thru. But I completely agree, it should be made more robust. My point was to show that the call may fail if $NupkgPath isn't quoted as it may contain spaces.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Odd practice there. ArgumentList is an array, so shouldn't they have just done this instead?
If for some reason the manual string construction is needed, then all variables should be quoted (even
$NugetApiKey
), for safety.