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

Test-DbaDiskAlignment - corrected indentation #7369

Merged
merged 5 commits into from
May 27, 2021

Conversation

andreasjordan
Copy link
Contributor

@andreasjordan andreasjordan commented May 25, 2021

Just corrected the indentation to better be able to work on #6406. No other change to the code.
Update: Fixes #6406.

@potatoqualitee
Copy link
Member

I can't get this to format properly, @niphlod any suggestions? I even cut/pasted from VSCode, used Invoke-DbatoolsFormatter and I deleted the command and readded it. Wtheck.

@niphlod
Copy link
Contributor

niphlod commented May 26, 2021

don't get crazy over it, sometimes PSScriptAnalyzer is just ....... magic. And I start feeling that VSCode uses PSScriptAnalyzer with an interface Powershell hasn't.
I'll try to extrapolate the subtlety in a few hours, sorry for the hiccup.

@andreasjordan
Copy link
Contributor Author

I thinks it's the | ForEach-Object { with a pipeline inside of the block followed by another pipeline. I think we had a similar problem some months ago. Just rewrite the code?

@andreasjordan
Copy link
Contributor Author

Changed the description so we can close #6406. As long as I don't have to work on the command, I don't care about the indentation.

@potatoqualitee
Copy link
Member

Thank you, @niphlod!

Does that mean I can close this, @andreasjordan ?

@andreasjordan
Copy link
Contributor Author

I changed the description. Can you merge this change?

@niphlod
Copy link
Contributor

niphlod commented May 26, 2021

confermed, PSScriptAnalyzer hiccups on the foreach, attached you can find what it thinks should be the correct format.
Test-DbaDiskAlignment.ps1.txt

now that I'm so involved, I'll try to rewrite the parts that are that trap PSScriptAnalyzer in a hiccup and see what's what. Give me a few hours

@andreasjordan
Copy link
Contributor Author

Great. Thanks.

@potatoqualitee
Copy link
Member

Thanks to you both! How the heck did you get that to work, @niphlod ?

@potatoqualitee potatoqualitee merged commit 3f9bc9e into development May 27, 2021
@potatoqualitee potatoqualitee deleted the 6406_TestDbaDiskAlignment branch May 27, 2021 04:49
@niphlod
Copy link
Contributor

niphlod commented May 27, 2021

@potatoqualitee : just rewrote the ugly foreach-object with a zillion pipes to a plain foreach() with a returning pscustomobject.
that doesn't scare psscriptanalyzer that much.

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.

[Bug] unexpected behavior: disks reported twice
3 participants