Open mjcarrabine opened 5 years ago
Not requiring PowerShell Core allows me to continue to execute PowerShell from within Visual Studio using PowerShell Tools for Visual Studio's right-click --> Execute as Script functionality.
Split-Path : A parameter cannot be found that matches parameter name 'LeafBase'
[string] $DeploymentName = ((Split-Path $TemplateFile -LeafBase) + '-' + ((Get-Date).ToUniversalTime()).ToString('MMdd-HHmm')),
[string] $DeploymentName = (Get-ChildItem $TemplateFile).BaseName + '-' + ((Get-Date).ToUniversalTime()).ToString('MMdd-HHmm'),
I've pasted the alternate line to the script (the $Deployment assignment is now on line 19) but still get the same error.
Deploy-AzTemplate.ps1 requires PowerShell Az.
PowerShell Az supports Windows PowerShell and PowerShell Core (according to Introducing the new Azure PowerShell Az module):
Does Deploy-AzTemplate.ps1 require PowerShell Core 6.x?
PR #5972 added a call to
Split-Path $TemplateFile -LeafBase
which is resulting in me gettingSplit-Path : A parameter cannot be found that matches parameter name 'LeafBase'
when I run Deploy-AzTemplate.ps1 using Execute Script in Visual Studio 2017 in a Azure Resource Group Project which is executing in Windows PowerShell.