Windows batch and PowerShell passing variables issue.


if use variable instead of number build version value, not working.

suggestion?


batch script:
------------

set buildversion = 2.1

cd c:\scripts

powershell.exe -file deploy-axsis.ps1 %buildversion% (not working)
powershell.exe -file deploy-axsis.ps1 2.1 ( working) 



ps script:
----------

$buildversionmain=$args[0]



error:
-------
variable '$buildversionmain' cannot retrieved because has not been set.

you cannot have spaces between variable name , equal sign, spaces after equal sign become part of variable value.

set buildversion=2.1 


best regards
claus codam
consultant, developer
coretech - blog



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

Group Policy Event ID 1058 Error Code 1326 (The user name or password is incorrect)

Suspicious event log Event ID: 4905

DCOM received error "2147746132" from...