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 "The property 'Count' cannot be found on this object." #16

Merged
merged 1 commit into from
Feb 23, 2020

Conversation

MarkMichaelis
Copy link
Contributor

Fixed #15, by applying the array sub-expression operator on the return from Use-Config inside Add-Config.

Fixed ScoopInstaller#15, by applying the array sub-expression operator on the return from `Use-Config` inside `Add-Config`.
@chawyehsu
Copy link
Member

Ok, I found the reason is because of the different behavior in PS5 and PS6+.

# powershell 5
("{}" | ConvertFrom-Json -ErrorAction Stop).Count
# ouput empty            <--------------------
@("{}" | ConvertFrom-Json -ErrorAction Stop).Count
# output 0

# powershell 6+
("{}" | ConvertFrom-Json -ErrorAction Stop).Count
# output 0
@("{}" | ConvertFrom-Json -ErrorAction Stop).Count
# output 0

@chawyehsu chawyehsu merged commit 14079ad into ScoopInstaller:master Feb 23, 2020
@chawyehsu
Copy link
Member

Thanks for your contribution,

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.

"Add-Config : The property 'Count' cannot be found on this object. Verify that the property exists."
2 participants