When trying to build a module stored on a share using a pure UNC-path (i.e. \server\share\mymodule not mapped to a drive letter), the build fails with the error message
Get-SamplerAbsolutePath : Cannot bind arguments to parameter 'Path' because it is null.
At C:\Program Files\WindowsPowerShell\Modules\Sampler\0.118.1\tasks\Clean.ModuleBuilder.build.ps1:17 char:25
Verbose logs
-
How to reproduce
cd \\server\share\mymodule
.\build.ps1 .
Expected behavior
The Sampler should check that the path is not an UNC-path as some cmdlets doesn't work with UNC-paths and output an error referring to UNC-paths not being supported for source files.
Current behavior
The build fails, but it's not apparent it is because of the path being an UNC-path and not a drive letter path.
Suggested solution
I'm assuming that the param RelativeTo is the one that needs to be checked in the function Get-SamplerAbsolutePath.
if (([uri]$RelativeTo).IsUnc) {
Write-Error 'UNC paths not supported' -ErrorAction Stop
}
Problem description
When trying to build a module stored on a share using a pure UNC-path (i.e. \server\share\mymodule not mapped to a drive letter), the build fails with the error message
Verbose logs
How to reproduce
Expected behavior
The
Sampler
should check that the path is not an UNC-path as some cmdlets doesn't work with UNC-paths and output an error referring to UNC-paths not being supported for source files.Current behavior
The build fails, but it's not apparent it is because of the path being an UNC-path and not a drive letter path.
Suggested solution
I'm assuming that the param
RelativeTo
is the one that needs to be checked in the functionGet-SamplerAbsolutePath
.Operating system the target node is running
PowerShell version and build the target node is running
Module version used