xml - Read parameter from XAML Post build argument into Powershell Script -
i have powershell script reading node value according 'type' xml property file,now want read 1 parameter 'type' node value tfs git xaml build process.how can declare parameter in xaml build process , read @ time of build in script?
$env="read xaml build process" $xmldocpath="d:\*****\scriptsconfig.xml"; [xml]$xmlfile = get-content $xmldocpath; $pathtodropuicssandjss=$xml.objects.object | where-object {$_.type -eq $env} | select-object -expandproperty pathtodropuicssandjss $deployingpackagebranchfoldername=$xml.objects.object | where-object {$_.type -eq $args[0]} | select-object -expandproperty deployingpackagebranchfoldername $branchname=$xml.objects.object | where-object {$_.type -eq $env} | select-object -expandproperty branchname $projectname=$xml.objects.object | where-object {$_.type -eq $env} | select-object -expandproperty projectname $automation=$xml.objects.object | where-object {$_.type -eq $env} | select-object -expandproperty automation $deploymentenvironment=$xml.objects.object | where-object {$_.type -eq $env} | select-object -expandproperty deploymentenvironment
i able read parameter tfs command below
[cmdletbinding()] param([string]$args) $env=[string]$args
but parameter $env not working in below shown commands working outside block if displaying separately
$sourcedir = $env:tf_build_sourcesdirectory $xmldocpath="$sourcedir\scriptsconfig.xml"; [xml]$xmlfile = get-content $xmldocpath; $pathtodropuicssandjss=$xml.objects.object | where-object {$_.type -eq $env} | select-object -expandproperty pathtodropuicssandjss $deployingpackagebranchfoldername=$xml.objects.object | where-object {$_.type -eq $env} | select-object -expandproperty deployingpackagebranchfoldername $branchname=$xml.objects.object | where-object {$_.type -eq $env} | select-object -expandproperty branchname $projectname=$xml.objects.object | where-object {$_.type -eq $env} | select-object -expandproperty projectname $automation=$xml.objects.object | where-object {$_.type -eq $env} | select-object -expandproperty automation $deploymentenvironment=$xml.objects.object | where-object {$_.type -eq $env} | select-object -expandproperty deploymentenvironment
Comments
Post a Comment