Topic 1 · Question 164
After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.
An Azure administrator plans to run a PowerShell script that creates Azure resources.
You need to recommend which computer configuration to use to run the script.
Solution: Run the script from a computer that runs Linux and has the Azure CLI tools installed.
Does this meet the goal?
A. Yes
B. No
Top comment
Community votes:B · 6 (86%)A · 1 (14%)
Stan007▲ 143Highly votedAugust 16, 2019 08:30 pm
Answer is correct, Azure PowerShell requires Windows PowerShell to function. Azure CLI can't execute any powershell scripts.
18 more highly voted comments
STH▲ 90Highly votedAugust 05, 2019 03:25 pm
After Microsoft Learn : "Azure PowerShell is a module that you can install for Windows PowerShell, or PowerShell Core, which is a cross-platform version of PowerShell that runs on Windows, Linux or macOS. Azure PowerShell enables you to connect to your Azure subscription and manage resources."
So the solution is definitivly valid
So the solution is definitivly valid
hapeshig▲ 61Highly votedNovember 29, 2019 10:03 am
Needs PowerShell Core to run Powershell scripts,PowerShell Core can be installed on Windows,Linux and MacOS. In this case it's PS Core is not installed thus answer is B
Duke_Lew▲ 24Highly votedDecember 22, 2021 07:05 am
Answer is No.
To run PS on Linux machine, PS core 6.x and higher version has to be installed in it.
So, Run the script from a computer that runs Linux and has the Azure CLI tools installed
--> Wrong answer
Run the script from a computer that runs Linux and has the PowerShell core 6.x and higher version installed
--> Correct answer
Please check on the link that is what Microsoft replied:
https://social.msdn.microsoft.com/Forums/en-US/bdffa306-5d1e-4db6-b00e-dc1143e4d471/can-i-run-powershell-from-cli-in-linux?forum=windowsazuremanagement
To run PS on Linux machine, PS core 6.x and higher version has to be installed in it.
So, Run the script from a computer that runs Linux and has the Azure CLI tools installed
--> Wrong answer
Run the script from a computer that runs Linux and has the PowerShell core 6.x and higher version installed
--> Correct answer
Please check on the link that is what Microsoft replied:
https://social.msdn.microsoft.com/Forums/en-US/bdffa306-5d1e-4db6-b00e-dc1143e4d471/can-i-run-powershell-from-cli-in-linux?forum=windowsazuremanagement
srueda99▲ 18Highly votedSelected: BJuly 04, 2022 11:02 pm
Guys, stop OVERTHINKING the question and just focus on READ it. It doesn't say that you have PowerShell installed, period. Don't make suppositions. If you want to defend your point on why the answer is yes, then go ahead, but if you want to pass the exam, then choose NO. Because NO is the correct answer.
bytoki▲ 15Highly votedJune 10, 2021 01:02 am
This is another dumb trick question from Microsoft, but the answer is 'NO' because you need to technically have the powershell module installed. Getting powershell module installed is a trivial process though so this question has very little real world value.
bytoki▲ 15Highly votedJune 10, 2021 01:02 am
This is another dumb trick question from Microsoft, but the answer is 'NO' because you need to technically have the powershell module installed. Getting powershell module installed is a trivial process though so this question has very little real world value.
bytoki▲ 15Highly votedJune 10, 2021 01:02 am
This is another dumb trick question from Microsoft, but the answer is 'NO' because you need to technically have the powershell module installed. Getting powershell module installed is a trivial process though so this question has very little real world value.
bytoki▲ 15Highly votedJune 10, 2021 01:02 am
This is another dumb trick question from Microsoft, but the answer is 'NO' because you need to technically have the powershell module installed. Getting powershell module installed is a trivial process though so this question has very little real world value.
Moon▲ 14Highly votedNovember 24, 2019 08:59 am
Answer "No".
My understanding is the CLI commands/scripts are different from PowerShell once. Therefore, you can not use the Script of PowerShell on CLI of Linux.
My understanding is the CLI commands/scripts are different from PowerShell once. Therefore, you can not use the Script of PowerShell on CLI of Linux.
kbadger▲ 14Highly votedOctober 07, 2020 01:19 pm
It would be valid if it mentioned installing PS (Core) on Linux machine
Insanewhip▲ 11Highly votedSeptember 27, 2021 07:38 pm
I asked this question at the Microsoft Azure Virtual Training Day and the Expert replied with "Yes".
monsigs▲ 11Highly votedAugust 17, 2020 05:57 am
This is the only comment that actually make sense.
drdean▲ 10Highly votedJune 04, 2020 04:48 am
A PowerShell script is a file that contains PowerShell cmdlets and code. A PowerShell script needs to be
run in PowerShell.
PowerShell can now be installed on Linux. However, the question states that the computer has Azure CLI
tools, not PowerShell installed. Therefore, this solution does not meet the goal.
References:
https://docs.microsoft.com/en-us/powershell/scripting/components/ise/how-to-write-and-run-scripts-in-thewindows-
powershell-ise?view=powershell-6
run in PowerShell.
PowerShell can now be installed on Linux. However, the question states that the computer has Azure CLI
tools, not PowerShell installed. Therefore, this solution does not meet the goal.
References:
https://docs.microsoft.com/en-us/powershell/scripting/components/ise/how-to-write-and-run-scripts-in-thewindows-
powershell-ise?view=powershell-6
foreverlearner▲ 9Highly votedApril 26, 2020 12:06 pm
Answer is NO.
You can run Azure CLI commands from Powershell, but not vice versa.
You can run both CLI and Powershell commands from the Cloud Shell, but that's on the Portal, not local and not part of the Azure CLI tools.
You can run Powershell Core on Windows, Linux and Mac.
You can run Azure CLI commands from Powershell, but not vice versa.
You can run both CLI and Powershell commands from the Cloud Shell, but that's on the Portal, not local and not part of the Azure CLI tools.
You can run Powershell Core on Windows, Linux and Mac.
yassali▲ 9Highly votedMarch 04, 2020 07:35 am
i believ answer is NO , although powershell can be installed on linux machine but the question mentioned that the PC has only Azure CLI tool not powershell
praktikant▲ 9Highly votedFebruary 09, 2020 11:12 am
the answer is now "Yes"
lehoang15tuoi▲ 9Highly votedSeptember 23, 2020 04:35 am
Your answer is not quite to the point, but yes, we can run Powershell script from the Azure CLI
az vm run-command invoke --command-id RunPowerShellScript
https://docs.microsoft.com/en-us/azure/virtual-machines/windows/run-command
az vm run-command invoke --command-id RunPowerShellScript
https://docs.microsoft.com/en-us/azure/virtual-machines/windows/run-command
Cloudyuga▲ 8Highly votedJune 15, 2020 11:32 am
Answer is No
Explanation
A PowerShell script is a file that contains PowerShell cmdlets and code. A PowerShell script needs to be run in PowerShell.
PowerShell can now be installed on Linux. However, the question states that the computer has Azure CLI tools, not PowerShell installed. Therefore, this solution does not meet the goal.
References:
https://docs.microsoft.com/en-us/powershell/scripting/components/ise/how-to-write-and-run-scripts-in-thewindows- powershell-ise?view=powershell-6
Explanation
A PowerShell script is a file that contains PowerShell cmdlets and code. A PowerShell script needs to be run in PowerShell.
PowerShell can now be installed on Linux. However, the question states that the computer has Azure CLI tools, not PowerShell installed. Therefore, this solution does not meet the goal.
References:
https://docs.microsoft.com/en-us/powershell/scripting/components/ise/how-to-write-and-run-scripts-in-thewindows- powershell-ise?view=powershell-6