I have a runbook, which I have been using for several years (with modifications). When created, it was defined to use Powershell version 5.1. The runbook is run daily through Automation.
I am now beginning to use Powershell 7.1 elsewhere, and would therefore like also to use that version in this runbook. But I cannot find ways to upgrade from Powershell 5.1 to 7.1.
How can I accomblish this task?
I have search through all runbook related properties in Azure, and tried to find a solution through Google, but in vain.
According to this Q&A discussion, the migration from PowerShell
5.1
to the most recent releases (7.1 or 7.2
) is still processing. The update for altering existing runtime versions has not yet been provided.As a workaround, if you need to update the
PowerShell
runtime version go to the below path and update Az modules to7.1
. It will automatically takePowerShell 7.1
runtime modules once you updated.Path:
Automation account >> Shared resources >> Modules >> Update Az Modules
Alternatively, you can use PowerShell command
Set-AzAutomationModule
as another workaround to achieve your requirement.Here I've downloaded the required PowerShell module from PowerShell Gallery and uploaded the module from local to Azure storage container. And later I provided the uploaded blob URL in place of
ContentLinkUri
with the link version as shown.