问题描述
我是天蓝色RM模型的新手.请帮助我使用Powershell脚本或API在资源管理器门户中创建的VM中复制并安装exe.预先感谢.
I am new to azure RM model.Please help me to copy and install an exe in VM created in resource manager portal using powershell script or using API. Thanks in advance.
推荐答案
如果要远程安装EXE,则需要将VM配置为允许进行远程管理-您可以通过WinRM进行此操作.请参阅: https://www .penflip.com/powershellorg/secrets-of-powershell-remoting/blob/master/accessing-remote-computers.txt 和 http://tarkus.me/post/64761019099/windows-azure-vms-remote-management
If you want to do the install the EXE remotely then the VM needs to be configured to allow for remote management - you can do this via WinRM. See: https://www.penflip.com/powershellorg/secrets-of-powershell-remoting/blob/master/accessing-remote-computers.txt and http://tarkus.me/post/64761019099/windows-azure-vms-remote-management
设置非常简单(您需要确保它的安全性).您也可以尝试将VM扩展名添加到将进行复制的VM中.由于已经提供了虚拟机,所以我认为这里唯一的选择就是使用DSC,尽管我从未在虚拟机后置中添加DSC扩展,但它应该可以工作.除了添加扩展名之外,这还需要编写和暂存DSC脚本,但肯定不如启用远程管理那么复杂.
Setting this up is non-trivial (you need to ensure it's secure). You could also try adding an VM extension to the VM that will do the copy. Since the VM is already provision I think the only option here would be to use DSC though I've never added a DSC extension to a VM post-provisioning, it should work. That would require authoring and staging a DSC script in addition to adding the extension but definitely less complex than enabling remote management.
到目前为止,最简单的方法就是Gaurav建议并登录到VM并从那里复制.
Simplest by far is as Gaurav suggested and log on to the VM and copy from there.
这篇关于在资源管理器门户中创建的Azure虚拟机中安装exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!