Closed samartzidis closed 11 months ago
Hi,
This piece of code:
$commonParams = @{ Name = 'nxFile' Property = @{ DestinationPath = "/tmp/dummy.txt"; Ensure = "Absent" } ModuleName = 'nxTools' Verbose = $true } Invoke-DscResource @commonParams -Method Set
Results in error: Remove-Item: Cannot bind argument to parameter 'Path' because it is null.
Remove-Item: Cannot bind argument to parameter 'Path' because it is null.
Issue is in line 410 of nxFile.ps1:
https://github.com/Azure/nxtools/blob/cbfc8880fa2dd7cf0859072100d0017e43a1e4d6/source/Classes/1.DscResources/01.nxFile.ps1#L410C36-L410C68
410: Remove-Item -Path $nxFileSystemInfo.DestinationPath -Force:($this.Force) -Recurse:($this.Recurse) -Confirm:$false
Should be:
410: Remove-Item -Path $nxFileSystemInfo.FullName -Force:($this.Force) -Recurse:($this.Recurse) -Confirm:$false
As $nxFileSystemInfo does not have a property named DestinationPath but FullName instead.
Thanks.
Hi,
This piece of code:
Results in error:
Remove-Item: Cannot bind argument to parameter 'Path' because it is null.
Issue is in line 410 of nxFile.ps1:
https://github.com/Azure/nxtools/blob/cbfc8880fa2dd7cf0859072100d0017e43a1e4d6/source/Classes/1.DscResources/01.nxFile.ps1#L410C36-L410C68
Should be:
As $nxFileSystemInfo does not have a property named DestinationPath but FullName instead.
Thanks.