Open pcgeek86 opened 8 years ago
@pcgeek86 Simple parameter validation. Adding in the automation team for a fix.
Additionally the current directory should be respected. When I execute the command in D:\mydscstuff
and use .\mysuperconfiguration.ps1
I'll receive the same message as Trevor although the file does exist. Using (Get-Item .\mysuperconfiguration.ps1).FullName
does the trick.
@vrdmr Can you take a look at this feature request?
Issue
The
Import-AzureRmAutomationDscConfiguration
command doesn't check for the existence of the file path specified in the-SourcePath
parameter. If the file doesn't exist, the command still attempts to make the API call to Microsoft Azure, which returns the exception below.Expected Result
The
Import-AzureRmAutomationDscConfiguration
command should check for the existence of the file in-SourcePath
before it attempts to make any API calls against Azure. If the file does not exist, a more useful error message should be thrown, instead of the generic one coming back from the ARM REST API.Cheers, Trevor Sullivan Microsoft MVP: PowerShell http://trevorsullivan.net http://twitter.com/pcgeek86