Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

shell using Loops to Add Element in XML File in Powershell

$xmlFragment=$log.CreateDocumentFragment()
$clients = 'Sample1.com','Sample2.com'    
$targets = $log.selectnodes('//Data')

for ($i = 0; $i -lt $targets.Count; $i++) {
    $rows = $targets[$i].selectnodes(".//Row")
    $item = $clients[$i]
    $new_node = "<client>$item</client>"    
    foreach ($row in $rows) {
        $xmlFragment.InnerXML=$new_node
        $row.PrependChild($xmlFragment)
    }
}
Comment

PREVIOUS NEXT
Code Example
Shell :: Error: Error: rpmdb open failed 
Shell :: update pulumi 
Shell :: kill process based on username windows 
Shell :: open app in background linux 
Shell :: restore gpg key 
Shell :: npm passport facebook 
Shell :: cd to a sub-directory 
Shell :: test(abc,def); = test(test1,test2); 
Shell :: Adding the daily DevCard to your GitHub profile 
Shell :: -s https://raw.githubusercontent.com/nathanchance/chromeos-adb-fastboot/master/install.sh | bash 
Shell :: linux stop xmrig 
Shell :: how to clear linux terminal 
Shell :: gitlab windows containers build pipeline 
Shell :: set up monitor refresh rate from command line fedora 
Shell :: Warning: Pub installs executables into $HOME/.pub-cache/ 
Shell :: mongo-sanitize github 
Shell :: bash bracket operators 
Shell :: bash command to pretty print directory 
Shell :: run antlr 
Shell :: how to access external drives from linux chrome os 
Shell :: ubuntu sysmon 
Shell :: install wii save files dolphin 
Shell :: fat-free migration 
Shell :: batch write to file 
Shell :: Storm Breaker ModuleNotFoundError: No module named "pyngrok" 
Shell :: login as root debian 
Shell :: install coreutils 
Shell :: azure powershell runbook to start a virtual machine 
Shell :: tools for debuging a server 
Shell :: digital assistant 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =