Variables are not getting replaced in powershell cmdlet -
this question has answer here:
- expand variable inside single quotes 2 answers
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
Post a Comment