Merged PR 38690: Update MaxVisitCount and MaxHashtableKeyCount if visitor safe value context indicates SkipLimitCheck is true
----
#### AI description (iteration 1)
#### PR Classification
Bug fix that updates the safe value checks by dynamically adjusting limit values based on the visitor context to improve security.
#### PR Summary
This pull request refactors the safe value visitor logic to replace hard-coded limit constants with context-driven readonly fields and adjusts the conditional checks accordingly. It also adds a test to verify that insecure psd1 files correctly fail when the -SkipLimitCheck parameter is used.
- `src/System.Management.Automation/engine/parser/SafeValues.cs`: Replaces constant limits with dynamic fields (_maxVisitCount and _maxHashtableKeyCount) set based on the safe value context, and updates conditional checks to use these fields.
- `test/powershell/Modules/Microsoft.PowerShell.Utility/PowerShellData.tests.ps1`: Adds a test case to ensure that insecure psd1 files trigger an error when -SkipLimitCheck is applied.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
Related work items: #163511
Updates the Test-Json cmdlet to use JsonSchema.Net instead of NJsonSchema in order to:
- use System.Text.Json instead of Newtonsoft
- support the latest JSON Schema drafts (up to 2020-12)
* Added SkipLast parameter set to Skip parameter and updated tests
* Using Should -BeExactly with string
* Update test/powershell/Modules/Microsoft.PowerShell.Utility/Select-Object.Tests.ps1
---------
Co-authored-by: Travis Plunk <travis.plunk@microsoft.com>
Co-authored-by: Travis Plunk <github@ez13.net>
* Add `Get-SecureRandom` cmdlet
* update comments
* address Paul and Travis' comments
* Update test/powershell/Modules/Microsoft.PowerShell.Utility/Get-SecureRandom.Tests.ps1
Co-authored-by: James Truher [MSFT] <jimtru@microsoft.com>
* address codefactor
* address Ilya's feedback creating a base class for both cmdlets
* remove unused `using`
---------
Co-authored-by: James Truher [MSFT] <jimtru@microsoft.com>
* Add CI for win-arm64
* Add common function to test for windows arm64
* Update because string where items need investigation
---------
Co-authored-by: Aditya Patwardhan <adityap@microsoft.com>