我需要从一个批号卷宗中开立一个权力书,而权力书则接受参数。 今天,我从一行手脚跟着:
cmd.exe /C pwsh.exe -Command "& {C: emp est.ps1 -ForceFullSync -AzureUserFilterOverride { $users | Where-Object { ($_.assignedLicenses.Count -ge 1) -and ($_.userPrincipalName -match domain.com ) } } -CompanyId bb8083d14755f910291fe0e8036d43ea -ManageObjects Contact -AzureUserPropertyList @(@{ msProp = accountEnabled ; mappedProp = active }, @{ msProp = businessPhones ; mappedProp = phone }, @{ msProp = givenName ; mappedProp = first_name }, @{ msProp = mail ; mappedProp = email }, @{ msProp = mobilePhone ; mappedProp = mobile_phone }, @{ msProp = onPremisesImmutableId ; mappedProp = u_correlation_id }, @{ msProp = surname ; mappedProp = last_name }, @{ msProp = userPrincipalName ; mappedProp = user_name }, @{ msProp = assignedLicenses ; mappedProp = }) -SecretId 120953 -AzureAdTenantDomain domain.onmicrosoft.com -ServiceNowBaseUri https://testinstance.service-now.com -IdentityProviderSysId 5ffa40e4975a391077dd7a76f053afbf -LogPath C: empdomainlog.txt -Verbose; Exit $LASTEXITCODE }"
这项工作fine,但难以读(而且会随着附加参数而花更长时间),因此我要按行文加以打破。 我尝试如下:
cmd.exe /C pwsh.exe -Command "& {
C: emp est.ps1 `
-ForceFullSync `
-AzureUserFilterOverride { `$users | Where-Object { ($_.assignedLicenses.Count -ge 1) -and ($_.userPrincipalName -match domain.com ) } } `
-CompanyId bb8083d14755f910291fe0e8036d43ea `
-ManageObjects Contact `
-AzureUserPropertyList @(
@{ msProp = accountEnabled ; mappedProp = active },
@{ msProp = businessPhones ; mappedProp = phone },
@{ msProp = givenName ; mappedProp = first_name },
@{ msProp = mail ; mappedProp = email },
@{ msProp = mobilePhone ; mappedProp = mobile_phone },
@{ msProp = onPremisesImmutableId ; mappedProp = u_correlation_id },
@{ msProp = surname ; mappedProp = last_name },
@{ msProp = userPrincipalName ; mappedProp = user_name },
@{ msProp = assignedLicenses ; mappedProp = }
) `
-SecretId 120953 `
-AzureAdTenantDomain domain.onmicrosoft.com `
-ServiceNowBaseUri https://testinstance.service-now.com `
-IdentityProviderSysId 5ffa40e4975a391077dd7a76f053afbf `
-LogPath C: empdomainlog.txt `
-Verbose; `
Exit `$LASTEXITCODE
}"
但是,当我管理下案卷时,我得到的是“灯塔”的开张。 在我结束发言时,指挥员向我显示:
c: emp>test.bat
c: emp>cmd.exe /C pwsh.exe -Command“&{C:emp est.ps1
c) 帝国;-ForceFullSync ` -ForceFullSync is not recognized as an internal or external command, operable program or batch file.
c) 帝国;-AzureUserFilterOverride {
$users | Where-Object { ($_.assignedLicenses.Count -ge 1) -and ($_.userPrincipalName -match domain.com ) } }
-AzureUserFilterOverride is not recognized as an internal or external command, operable program or batch file.c) 帝国;
以为依据 利用多线权力 壳牌照,由厘米d.exe 我试图用这样的谨慎性质来取代线背书:
cmd.exe /C pwsh.exe -Command "& {
C: emp est.ps1 ^
-ForceFullSync ^
-AzureUserFilterOverride { `$users | Where-Object { ($_.assignedLicenses.Count -ge 1) -and ($_.userPrincipalName -match domain.com ) } } ^
-CompanyId bb8083d14755f910291fe0e8036d43ea ^
-ManageObjects Contact ^
-AzureUserPropertyList @(
@{ msProp = accountEnabled ; mappedProp = active },
@{ msProp = businessPhones ; mappedProp = phone },
@{ msProp = givenName ; mappedProp = first_name },
@{ msProp = mail ; mappedProp = email },
@{ msProp = mobilePhone ; mappedProp = mobile_phone },
@{ msProp = onPremisesImmutableId ; mappedProp = u_correlation_id },
@{ msProp = surname ; mappedProp = last_name },
@{ msProp = userPrincipalName ; mappedProp = user_name },
@{ msProp = assignedLicenses ; mappedProp = }
) ^
-SecretId 120953 ^
-AzureAdTenantDomain domain.onmicrosoft.com ^
-ServiceNowBaseUri https://testinstance.service-now.com ^
-IdentityProviderSysId 5ffa40e4975a391077dd7a76f053afbf ^
-LogPath C: empdomainlog.txt ^
-Verbose; ^
Exit `$LASTEXITCODE
}"
但当时说的是,
c: emp>test.bat
c: emp>cmd.exe /C pwsh.exe - 通讯“和”;
c) 帝国;C: emp est.ps1 -ForceFullSync
-AzureUserFilterOverride { `$users | Where-Object { ($.assignedLicenses.Count -ge 1) -and ($.userPrincipalName -match domain.com ) } } -CompanyId bb8083d14755f910291fe0e8036d43ea
-ManageObjects Contact -AzureUserPropertyList @( Where-Object is not recognized as an internal or external command, operable program or batch file.c) 帝国;
我感觉到,我必须结束,但失踪的人不多。