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

xPackage: The variable '$Localized' cannot be retrieved because it has not been set. #449

Closed
codykonior opened this issue Oct 15, 2018 · 4 comments · Fixed by #563
Closed

Comments

@codykonior
Copy link
Contributor

codykonior commented Oct 15, 2018

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

Trying to install a package and got this error. I forgot to include two backward slashes (it's a network location) so it is expected to have an error - but this ended with an unexpected different error message because there's a misnamed variable.

Verbose logs showing the problem

VERBOSE: [CHWS01]: LCM:  [ Start  Resource ]  [[xPackage]NetFx472]
VERBOSE: [CHWS01]: LCM:  [ Start  Test     ]  [[xPackage]NetFx472]
VERBOSE: [CHWS01]:                            [[xPackage]NetFx472] The path extension was .exe
VERBOSE: [CHWS01]: LCM:  [ End    Test     ]  [[xPackage]NetFx472]  in 0.1720 seconds.
C:\BootStrap\BootStrap.ps1 : PowerShell DSC resource MSFT_xPackageResource  failed to execute Test-TargetResource
functionality with error message: The variable '$Localized' cannot be retrieved because it has not been set.
At line:1 char:1
+ .\bootstrap.ps1
+ ~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,BootStrap.ps1

Suggested solution to the issue

Change:
Write-Verbose -Message ($Localized.TheUriSchemeWasUriScheme -f $uri.Scheme)
To:
Write-Verbose -Message ($localizedData.TheUriSchemeWasUriScheme -f $uri.Scheme)

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

                xPackage 'NetFx472' {
                    Name = 'NetFx472'
                    Path = "$($domainController.$($node.DomainName))\Resources\NDP472-KB4054530-x86-x64-AllOS-ENU.exe"
                    ProductId = ''
                    InstalledCheckRegKey = "SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full"
                    InstalledCheckRegValueName = "Release"
                    InstalledCheckRegValueData = "461814"
                    Arguments = "/q"
                    DependsOn  = '[WindowsFeatureSet]All', '[Computer]Rename'
                }

The operating system the target node is running

Windows Server 2012

Version and build of PowerShell the target node is running

WMF 5.1

Version of the DSC module that was used ('dev' if using current dev branch)

dev

@codykonior codykonior changed the title xPackageResource: The variable '$Localized' cannot be retrieved because it has not been set. xPackage: The variable '$Localized' cannot be retrieved because it has not been set. Oct 16, 2018
@stale
Copy link

stale bot commented Nov 15, 2018

This issue has been automatically marked as stale because it has not had activity from the community in the last 30 days. It will be closed if no further activity occurs within 10 days. If the issue is labelled with any of the work labels (e.g bug, enhancement, documentation, or tests) then the issue will not auto-close.

@stale stale bot added the stale The issue or pull request was marked as stale because there hasn't been activity from the community. label Nov 15, 2018
@stale
Copy link

stale bot commented Dec 25, 2018

This issue has been automatically closed because it is has not had activity from the community in the last 40 days.

@stale stale bot closed this as completed Dec 25, 2018
@codykonior
Copy link
Contributor Author

Unstale

@codykonior
Copy link
Contributor Author

Reopen.

@mhendric mhendric reopened this Feb 17, 2019
@stale stale bot removed the stale The issue or pull request was marked as stale because there hasn't been activity from the community. label Feb 17, 2019
mhendric added a commit that referenced this issue Feb 17, 2019
xPackage: Fix a misnamed variable #449
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

Successfully merging a pull request may close this issue.

2 participants