-
-
Notifications
You must be signed in to change notification settings - Fork 467
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
Cleanup alias and missing SafeCommands #1745
Conversation
Not part of this change, but if you want to come up with a rule that forces us to not use New-Object, Where-Object, Select-Object and ForEach-Object at all it would be nice to have that in a Draft PR. Those cmdlets are much slower than their normal counter parts. I don't have good replacement for some of the usages (as you saw with the Select-Object -First), but this analyzer rule would allow me to find all of them and fix them. We can probably replace Select-Object -First with call to .NET method that uses Linq. New-Object I already replace with Pester Factory where I create types using .NET constructor. |
After this cleanup, a simple search for e.g. If support for PSv3 was dropped then |
Co-authored-by: Jakub Jareš <me@jakubjares.com>
|
That is definitely not expected, Sort-Object should be used in all cases. |
No pressure, it was just an idea. I should first get my profiler to work properly and start measuring (if only on PS5.1 because that is the only place where it currently works).
Having v3 support is important because people still write modules that are compatible down to v3, so they should be able to test them easily. |
Yup. Could have given some different results on unix vs windows. Fixed now. Looks like the CI failure on PSv3 and v4 was caused by me removing one BOM too many in Mock.ps1. PSSA auto-fix added BOM, so had to remove manually, but didn't notice that Mock.ps1 had it originally. Non-consistent use of BOM by design or new issue? |
New issue. |
PR Summary
/src/*
to avoid usage of alias (related Pester crashes if user does not have aliasforeach
defined #1740)$SafeCommands['xxxx']
on external function-calls in/src/*
$SafeCommands
(defined in the dictionary)PR Checklist
Create Pull Request
to mark it as a draft. PR can be markedReady for review
when it's ready../build.ps1 -Clean; ./test.ps1 -NoBuild
. Use a new PowerShell process when C# code is changed.