PSArm icon indicating copy to clipboard operation
PSArm copied to clipboard

ConvertFrom-ArmTemplate doesn't work with relative paths

Open bjompen opened this issue 3 years ago • 8 comments

When running `ConvertFrom-ArmTemplate -Path .\MyTemplate.json' an error is thrown as the CmdLet looks for the template in the wrong folder. Using full path works as expected.

image

bjompen avatar Mar 31 '21 21:03 bjompen

I'm having trouble reproducing this:

image

rjmholt avatar Mar 31 '21 21:03 rjmholt

@rjmholt Is your template.json in the home directory?

alexandair avatar Mar 31 '21 21:03 alexandair

No, standard directory:

image

rjmholt avatar Mar 31 '21 21:03 rjmholt

Can you try with the attached?

PSArm.zip

rjmholt avatar Mar 31 '21 21:03 rjmholt

@bjompen what PowerShell version are you running?

rjmholt avatar Mar 31 '21 21:03 rjmholt

Can you try with the attached?

PSArm.zip

This works.

$PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.1.3
PSEdition                      Core
GitCommitId                    7.1.3
OS                             Microsoft Windows 10.0.19042
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

bjompen avatar Mar 31 '21 22:03 bjompen

PSVersion 7.1.3

Oh, interesting! I wonder if .NET made some changes under the hood. In any case, the linked PR should fix it.

rjmholt avatar Mar 31 '21 22:03 rjmholt

@bjompen please provide some details of your environment set up which at minimum should include the output of $PSVersionTable & what version of PSArm you are using

kilasuit avatar Apr 11 '21 22:04 kilasuit