You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In certain scenarios xArchive will fail. It seems to show up only in set certain scenarios:
-- zip file has a name that contains bracket
-- one of the files in the zip contains bracket, but most files are synced already (e.g. if file in question was removed).
Repro:
configurationBracketsInZip {
Import-DscResource-ModuleName @{
ModuleName='xPSDesiredStateConfiguration'RequiredVersion='4.0.0.0'
}
xArchive test {
Path ='C:\temp\testZip[.zip'
Destination ='C:\temp\TestWithBracket'
}
}
configurationBracketsInsideZip {
Import-DscResource-ModuleName @{
ModuleName='xPSDesiredStateConfiguration'RequiredVersion='4.0.0.0'
}
xArchive test {
Path ='C:\temp\testZip.zip'
Destination ='C:\temp\TestWithBracket'
}
}
# Testing zip file with odd name...
BracketsInZip -OutputPath c:\temp\bracket
Start-DscConfiguration-Path c:\temp\bracket -Wait -Verbose
# Error message...
PowerShell DSC resource MSFT_xArchive failed to execute Test-TargetResource functionality with error message: The specified wildcard character pattern is not valid: testZip[.zip# Testing zip file that contains files with odd name...BracketsInsideZip-OutputPathc:\temp\bracketStart-DscConfiguration-Pathc:\temp\bracket-Wait-Verbose-Force# Error message...VERBOSE: [ASUS]: [[xArchive]test] WritingtofileC:\temp\TestWithBracket\testZip\testFile[
VERBOSE: [ASUS]: LCM: [ EndSet ] [[xArchive]test] in0.1300seconds.PowerShellDSCresourceMSFT_xArchivefailedtoexecuteSet-TargetResourcefunctionalitywitherrormessage: Cannotretrievethedynamicparametersforthecmdlet.Thespecifiedwildcardcharacterpatternisnotvalid: testFile[
The fix: use -LiteralPath whenever possible. -Path assumes wildcards and shouldn't be used as individual files (rather than wildcards) are expected as input to any cmdlet called.
The text was updated successfully, but these errors were encountered:
In certain scenarios xArchive will fail. It seems to show up only in set certain scenarios:
-- zip file has a name that contains bracket
-- one of the files in the zip contains bracket, but most files are synced already (e.g. if file in question was removed).
Repro:
The fix: use -LiteralPath whenever possible. -Path assumes wildcards and shouldn't be used as individual files (rather than wildcards) are expected as input to any cmdlet called.
The text was updated successfully, but these errors were encountered: