简体   繁体   English

Azure PowerShell:是否可以从以ps1编写的脚本中调用bash命令?

[英]Azure PowerShell: Is it possible to call bash commands from script written in ps1?

I created ps1 script, which creates a Linux VirtualMachine and opens ssh session with it. 我创建了ps1脚本,该脚本创建了Linux VirtualMachine并使用它打开ssh会话。 And I would like to ask if it is somehow possible to have bash commands already written in this script. 我想问一下是否有可能已经在此脚本中编写了bash命令。 I mean, if I call my script.ps1, it creates my virtual machine, opens ssh session and does eg all apt-gets and so on. 我的意思是,如果我调用script.ps1,它将创建我的虚拟机,打开ssh会话并执行所有apt-get等操作。 Is it possible? 可能吗?

I am not sure if that is possible. 我不确定这是否可能。 Instead of that, i would recommend to do that using command-line interface which may be enabled in Bash. 取而代之的是,我建议使用可以在Bash中启用的命令行界面来执行此操作。 CLI is here - https://github.com/Azure/azure-xplat-cli CLI在这里-https://github.com/Azure/azure-xplat-cli

Bash in Windows (if you are going to use Windows) is possible only in the latest Windows 10 builds , so you will need to integrate that possibilities somehow Windows中的Bash(如果要使用Windows) 只能在最新的Windows 10版本中使用 ,因此您将需要以某种方式集成这种可能性

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM