Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New-ZipFromPSModulePath helper function (DscPullServerSetup\DscPullServerSetup.psm1): Bug when renaming the .zip file #722

Open
lavanack opened this issue Jun 1, 2021 · 1 comment

Comments

@lavanack
Copy link

lavanack commented Jun 1, 2021

Details of the scenario you tried and the problem that is occurring

When using the Publish-DSCModulesAndMof helper function it raises the following error

Verbose logs showing the problem

Rename-Item : Cannot rename the specified target, because it represents a path or device name.
At C:\Program Files\WindowsPowerShell\Modules\xPSDesiredStateConfiguration\9.1.0\Modules\DscPullServerSetup\DscPullServerSetup.psm1:145 char:21

  • ... $null = Rename-Item -Path "$source.zip" -NewName $newName -Force
  •              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidArgument: (:) [Rename-Item], PSArgumentException
    • FullyQualifiedErrorId : Argument,Microsoft.PowerShell.Commands.RenameItemCommand

Suggested solution to the issue

The line $newName = "$Destination$name" + '' + "$version" + '.zip' should be
$newName = "$name" + '
' + "$version" + '.zip'

The DSC configuration that is used to reproduce the issue (as detailed as possible)

# insert configuration here

The operating system the target node is running

OsName : Microsoft Windows Server 2019 Standard
OsOperatingSystemSKU : StandardServerEdition
OsArchitecture : 64-bit
WindowsVersion : 1809
WindowsBuildLabEx : 17763.1.amd64fre.rs5_release.180914-1434
OsLanguage : en-US
OsMuiLanguages : {en-US}

Version and build of PowerShell the target node is running

Name Value


PSVersion 5.1.17763.1490
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.1490
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Version of the DSC module that was used

9.1.0

@lavanack
Copy link
Author

Still no fix ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant