Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
April 17, 2024 03:24 am GMT

Cch a bin mi trng thnh mt phn ca mt commandline PowerShell

Ti gp mt bi ton nh th ny:
Command ti cn chy:

.\octo.exe deploy-release --project ""ClientPortal"" --channel $ClientPortal_Channel --version=$ClientPortal_ReleaseNumber --deployto $ClientPortal_Env --ignoreSslErrors $ClientPortal_Tenant --progress --updateVariables

c bit vi $ClientPortal_Tenant l mt chui m ti mun n tr thnh mt phn ca command trn.

Gi tr ca $ClientPortal_Tenant l:
--tenant ABC --tenant ABD --tenant ABE --tenant ABX

Nhng khi thc hin, th bo li ngay, v bin mi trng trong trng hp ny c hiu nh mt argument, ko phi l mt thnh phn ca command.

gii quyt, ta s dng lnh Invoke-Expression, mt command trong powershell cho php thc thi lnh t mt chui c sn.

Sa li nh sau:

$ClientPortal=".\octo.exe deploy-release --project ""ClientPortal"" --channel $ClientPortal_Channel --version=$ClientPortal_ReleaseNumber --deployto $ClientPortal_Env --ignoreSslErrors $ClientPortal_Tenant --progress --updateVariables"> Invoke-Expression $ClientPortal

Original Link: https://dev.to/bachhuynh/cach-dua-bien-moi-truong-thanh-mot-phan-cua-mot-commandline-o-powershell-598n

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To