使用PowerShell解析XML POST请求中的变量

时间:2017-09-25 10:19:45

标签: xml powershell variables soap

我试图将变量(日期)添加到XML帖子中,但我无法使其发挥作用。 在XML帖子中,我需要指定2个日期(vndg =今天和morg =今天+ 1)。

这是我的PowerShell脚本,它没有日期变量。

foreach ($o in $ous){

Write-Host "Creating OU: " $o
NEW-ADOrganizationalUnit $o

Write-Host "Create Group $o"
New-ADGroup -Name "$o" -SamAccountName $o -GroupCategory Security -GroupScope Global -DisplayName "$o" -Path "CN=Users,DC=lovely,DC=local" -Description "$o department"  

# Create department dir
New-Item -Path "$dir\$o" -ItemType Directory   

$colRights = [System.Security.AccessControl.FileSystemRights]"Read, Write,Traverse"
$InheritanceFlag = [System.Security.AccessControl.InheritanceFlags]::None 
$PropagationFlag = [System.Security.AccessControl.PropagationFlags]::InheritOnly 
$objType =[System.Security.AccessControl.AccessControlType]::Allow 
$objUser = New-Object System.Security.Principal.NTAccount("$o") 
$objACE = New-Object System.Security.AccessControl.FileSystemAccessRule ($objUser, $colRights, $InheritanceFlag, $PropagationFlag, $objType) 
$objACL = Get-ACL "$dir\$o" 
$objACL.AddAccessRule($objACE) 
Set-ACL "$dir\$o" $objACL

1 个答案:

答案 0 :(得分:0)

我通过将脚本更改为以下内容来实现它:

private void PART_MinButton_MouseLeave(object sender, MouseEventArgs e)
{
    Button btn = sender as Button;
    (btn.ToolTip as ToolTip).IsOpen = false;
}