Variables are not getting replaced in powershell cmdlet -


this question has answer here:

i using start-process cmdlet in powershell as

start-process -filepath "$installer_path" -args '/s /v"/qb setuptype=\"$setup_type\" username=$user_name password=$password server=$sql_server installdir=\"$transfer_path\\\" sharepath=\"$transfer_path\\\""' –wait 

in above command variable not getting replaced except $installer_path. believe issue because of variables located inside ' " " '. 1 me variable substitution?

thanks.

the problem using single quotes , not double quotes. in order variables expand need use double quotes. if have use double quotes inside of can escape them preceding them backtick ` or doubling them "".

start-process -filepath "$installer_path" -args "/s /v`"/qb setuptype=\`"$setup_type\`" username=$user_name password=$password server=$sql_server installdir=\`"$transfer_path\\\`" sharepath=\`"$transfer_path\\\`"`"" –wait 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -