如何在同一脚本中同时运行两个powershell函数?
我对powershell中的异步调用做了大量研究,但没有任何东西可以正常工作 我需要找到一种方法,让两个独立的数据库查询同时运行。我通过crm dynamics有一个内部连接和一个在线连接如何在同一脚本中同时运行两个powershell函数?,powershell,dynamics-crm,Powershell,Dynamics Crm,我对powershell中的异步调用做了大量研究,但没有任何东西可以正常工作 我需要找到一种方法,让两个独立的数据库查询同时运行。我通过crm dynamics有一个内部连接和一个在线连接 function Get-OnPremiseDBQuery { $onPremResultsLocation = "..\results\onPremRecordsCountByEntity.txt" $onPremRecordSummary = @() foreac
function Get-OnPremiseDBQuery {
$onPremResultsLocation = "..\results\onPremRecordsCountByEntity.txt"
$onPremRecordSummary = @()
foreach ($entityGroup in $entitiesArray) {
$onPremRecordSummaryByGroup = Get-OnPremiseRecordsCountSummary -onPremConnection $onPremCRMConnection -entityNames $entityGroup
$onPremRecordSummary += $onPremRecordSummaryByGroup
Write-Host "ON PREM"
Write-Host $onPremRecordSummaryByGroup | Format-Table -Property * -AutoSize | Out-String -Width 4096
}
Write-Output $onPremRecordSummary | Format-Table -Property * -AutoSize | Out-String -Width 4096 | Out-File $onPremResultsLocation -Append
}
function Get-OnlineDBQuery {
$onlineResultsLocation = "..\results\onlineRecordsCountByEntity.txt"
$onlineRecordSummary = @()
foreach ($entityGroup in $entitiesArray) {
$onlineRecordSummaryByGroup = Get-OnLineRecordsCountSummary -onlineConnection $onlineCRMConnection -entityNames $entityGroup
$onlineRecordSummary += $onlineRecordSummaryByGroup
Write-Host "ONLINE"
Write-Host $onlineRecordSummaryByGroup | Format-Table -Property * -AutoSize | Out-String -Width 4096
}
Write-Output $onlineRecordSummary | Format-Table -Property * -AutoSize | Out-String -Width 4096 | Out-File $onlineResultsLocation -Append
}
#Async Query Calls to onpremis/online DBs
##Looking to find a way to run
Get-OnPremiseDBQuery
and
Get-OnlineDBQuery
AT THE SAME TIME
如果有人能帮忙,请帮忙 这类工作正是PowerShell作业和运行空间的设计目标 至于 我在powershell和我的 没有任何东西可以正常工作 你是说,你有下面的杠杆作用,但没有一个选项对你有效 你也没有定义你所说的 我没有任何东西可以正常工作
- 什么不起作用李>
- 您得到了哪些响应/错误
这种努力正是PowerShell作业和运行空间设计的目的 至于 我在powershell和我的 没有任何东西可以正常工作 你是说,你有下面的杠杆作用,但没有一个选项对你有效 你也没有定义你所说的 我没有任何东西可以正常工作
- 什么不起作用李>
- 您得到了哪些响应/错误