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

Fix null-valued expression error #279

Merged

Conversation

NAshwini
Copy link
Member

@NAshwini NAshwini commented Oct 4, 2019

Signed-off-by: NAshwini ashwini.nehate@msystechnologies.com

Description

Fix null-valued expression error for powershell command. This code change will now work for both Chef Client and Chef Infra Client i.e till 14.x and 15.x

Stacktrace

Execution Error:
Where-Object : You cannot call a method on a null-valued expression.
At C:\Packages\Plugins\Chef.Bootstrap.WindowsAzure.ChefClient\1210.13.2.1\bin\chef-install.psm1:30 char:40
+ ... lass Win32_Product | Where-Object { $_.Name.contains("Chef Client") }
+                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Where-Object], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull,Microsoft.PowerShell.Commands.WhereObjectCommand

Signed-off-by: NAshwini <ashwini.nehate@msystechnologies.com>
@NAshwini NAshwini changed the title Fix null-valued expression error [MSYS-1103] Fix null-valued expression error Oct 4, 2019
@NAshwini NAshwini changed the title [MSYS-1103] Fix null-valued expression error [W.I.P] [MSYS-1103] Fix null-valued expression error Oct 4, 2019
@NAshwini NAshwini changed the title [W.I.P] [MSYS-1103] Fix null-valued expression error [MSYS-1103] Fix null-valued expression error Oct 7, 2019
@Vasu1105 Vasu1105 changed the title [MSYS-1103] Fix null-valued expression error Fix null-valued expression error Oct 15, 2019
@Vasu1105 Vasu1105 merged commit 54f7bb3 into chef-partners:master Oct 15, 2019
@NAshwini NAshwini deleted the ash/Fix_null_method_error branch June 11, 2020 06:29
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 this pull request may close these issues.

3 participants