答案 0 :(得分:3)
在调用New-ADUser
之前,您需要Set-ADAccountPassword
cmdlet的语句终止符。
您可以使用;
,也可以将Set-ADAccountPassword
放在另一行:
Import-Csv C:\Users\Administrator\Desktop\properties1.csv |ForEach-Object {
New-ADUser -path "OU=Users,OU=ICTLAB,DC=gdgshj,DC=com" -UserPrincipalName $_.UserPrincipalName -SamAccountName $_.SamAccountName -GivenName $_.GivenName -Name $_.Name -DisplayName $_.DisplayName -profilepath $_.Profilepath
Set-ADAccountPassword -Identity $_.SamAccountName -Reset -NewPassword (ConvertTo-SecureString -AsPlainText $_.Password -Force)
Enable-ADAccount -Identity $_.SamAccountName
}
如果您使用-PassThru
和New-ADUser
上的Set-ADAccountPassword
开关,也可以在一个管道中将命令链接在一起(注意每个|
末尾的Import-Csv C:\Users\Administrator\Desktop\properties1.csv |ForEach-Object {
New-ADUser -path "OU=Users,OU=ICTLAB,DC=gdgshj,DC=com" -UserPrincipalName $_.UserPrincipalName -SamAccountName $_.SamAccountName -GivenName $_.GivenName -Name $_.Name -DisplayName $_.DisplayName -profilepath $_.Profilepath -PassThru |
Set-ADAccountPassword -Reset -NewPassword (ConvertTo-SecureString -AsPlainText $_.Password -Force) -PassThru |
Enable-ADAccount
}
线):
import gdal
import numpy as np
import math
import osgeo
import os
import scipy
# Open Rasters
hvRaster = gdal.Open("C:\\Users\\moses\\Desktop\\Calc_Test\\IMG-HV-ALOS2110871010-160611-HBQR1.5RUA.img")
vhRaster = gdal.Open("C:\\Users\\moses\\Desktop\\Calc_Test\\IMG-VH-ALOS2110871010-160611-HBQR1.5RUA.img")
# Get Raster Band
hvRasterBand = hvRaster.GetRasterBand(1)
vhRasterBand = vhRaster.GetRasterBand(1)
# Convert Raster to Array
hvArray = np.array(hvRaster.GetRasterBand(1).ReadAsArray())
vhArray = np.array(vhRaster.GetRasterBand(1).ReadAsArray())
print hvArray
print vhArray