Update AzF profile to be useful by rjmholt · Pull Request #1341 · PowerShell/PSScriptAnalyzer
PR Summary
I've run the profile collector on the AzF profile (with some difficulty) and collected a new profile that captures the default Az installation.
I've also removed cmdlets that don't work in AzF despite being present, like Start-Job and Enter-PSSession.
I had to make some small changes to the profile collector to not crash (plus one where I realised that collecting a function if we're not able to load it is unhelpful).
PR Checklist
- PR has a meaningful title
- Use the present tense and imperative mood when describing your changes
- Summarized changes
- Change is not breaking
- Make sure all
.cs,.ps1and.psm1files have the correct copyright header - Make sure you've added a new test if existing tests do not effectively test the code changed and/or updated documentation
- This PR is ready to merge and is not Work in Progress.
- If the PR is work in progress, please add the prefix
WIP:to the beginning of the title and remove the prefix when the PR is ready.
- If the PR is work in progress, please add the prefix
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok to me but it broke 1 CI test:
Context Targeting new-form Az profiles alongside older profiles
[-] Finds AzF problems with a script 7.37s
KeyNotFoundException: The given key 'InDisconnectedSession' was not present in the dictionary.
at <ScriptBlock>, C:\projects\psscriptanalyzer\Tests\Rules\UseCompatibleCommands.Tests.ps1: line 334
Impressive that testing picked that up!
Have to credit you entirely for that @bergmeister -- you asked for those tests.
Looks like they're working now. Hopefully the Lazys don't hide other faults. I took out parameters and commands manually, and it looks like I took a parameter out without its alias there.