Skip to content

SaveDscDependency throws error on Linux #1228

Description

@bgelens

Steps to reproduce

Run with version 1.18.0 using SaveDscDependency switch on an arbitrary ps1 file (doesn't have to be a configuration) on Linux (I'm running Ubuntu 18.04 on WSL).

It works fine on Windows when using PowerShell 6.2.

Invoke-ScriptAnalyzer -Path '/mnt/c/justascript.ps1' -SaveDscDependency

Expected behavior

Just run without an issue

Actual behavior

Invoke-ScriptAnalyzer : Value cannot be null.
Parameter name: path1
At line:1 char:1
+ Invoke-ScriptAnalyzer -Path '/mnt/c/Projects/GO-M-Automation/Src/Prod ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [Invoke-ScriptAnalyzer], ArgumentNullException
+ FullyQualifiedErrorId : System.ArgumentNullException,Microsoft.Windows.PowerShell.ScriptAnalyzer.Commands.InvokeScriptAnalyzerCommand
PSMessageDetails      :
Exception             : System.ArgumentNullException: Value cannot be null.
                        Parameter name: path1
                           at System.IO.Path.Combine(String path1, String path2)
                           at
                        Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.ModuleDependencyHandler..ctor(Runspace
                        runspace, String moduleRepository, String tempPath, String localAppDataPath)
                           at Microsoft.Windows.PowerShell.ScriptAnalyzer.Commands.InvokeScriptAnalyzerCommand.ProcessR
                        ecord()
                           at System.Management.Automation.Cmdlet.DoProcessRecord()
                           at System.Management.Automation.CommandProcessor.ProcessRecord()
TargetObject          :
CategoryInfo          : NotSpecified: (:) [Invoke-ScriptAnalyzer], ArgumentNullException
FullyQualifiedErrorId : System.ArgumentNullException,Microsoft.Windows.PowerShell.ScriptAnalyzer.Commands.InvokeScriptA
                        nalyzerCommand
ErrorDetails          :
InvocationInfo        : System.Management.Automation.InvocationInfo
ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo : {}

Environment data

> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      6.2.0
PSEdition                      Core
GitCommitId                    6.2.0
OS                             Linux 4.4.0-43-Microsoft #1-Microsoft Wed Dec 31 14:42:53 PST 2014
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

> (Get-Module -ListAvailable PSScriptAnalyzer).Version | ForEach-Object { $_.ToString() }
1.18.0
1.17.1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions