Invoke-AzureRMVMRunCommand运行时间长(20-30分钟),而在VM中以交互方式运行的脚本需要10秒 [英] Invoke-AzureRMVMRunCommand takes a LONG TIME to run (20-30 minutes) whereas the script when run interactively in a VM takes 10 seconds
问题描述
此命令需要20-30分钟才能运行:
Invoke-AzureRMVMRunCommand -ResourceGroupName< RESOURGEGROUPNAME> -CommandId'RunPowerShellScript'-scriptpath'2011-03-21-STOP_Services.ps1'-asJob -vmname< VMNAME>
## ########## STOP_Services.ps1 #############
get-service * veeam * |停止服务
get-service * veeam * | set-service -startuptype disabled
get-service * vmic * |停止服务
get-service * vmic * | set-service -startuptype disabled
################################# #####
如果我在RDP进入AZURE VM后运行STOP_Services.ps1,则运行大约需要5秒钟。 / p>
如何让Invoke-AzureRMVMRunCommand执行得更快?
可以使用-debug和-verbose运行命令并将结果分享给我?
问候,
Msrini
This command takes 20-30 minutes to run:
Invoke-AzureRMVMRunCommand -ResourceGroupName <RESOURGEGROUPNAME> -CommandId 'RunPowerShellScript' -scriptpath '2019-03-21-STOP_Services.ps1' -asJob -vmname <VMNAME>
############ STOP_Services.ps1 #############
get-service *veeam* | stop-service
get-service *veeam* | set-service -startuptype disabled
get-service *vmic* | stop-service
get-service *vmic* | set-service -startuptype disabled
######################################
If I run STOP_Services.ps1 after I RDP into a AZURE VM, it takes approx 5 seconds to run.
What can I do to make Invoke-AzureRMVMRunCommand execute faster ?
Hi,
Can run the command with -debug and -verbose and share me the results?
Regards,
Msrini
这篇关于Invoke-AzureRMVMRunCommand运行时间长(20-30分钟),而在VM中以交互方式运行的脚本需要10秒的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!