Repository navigation
Report why the configuration file could not be used - #14
Merged
Merged
Conversation
- Four places said quoted text in a boolean setting reads as off, but the text "true" in any letter case compares equal to $true, so it reads as on: the rule in AGENTS.md, the From source paragraph in Research_Notes/PowerShell-Language-Behavior.md section 10, the IncludeBCCInGroupChat comment in Send-ScriptMessage, and the comment above the quoted-"false" tests. The code already behaved this way; only the wording changes. - Changelog: the Minor entry about validating configuration file settings overstated it. Nothing is validated, and only IncludeBCCInGroupChat and MgDisconnectWhenDone read differently from 1.1.1; the MgDelegatedPermission_* settings already used -eq $true. Reword it as reading every true/false setting the same way. - Fix the installed-module scratch script, which imported Script-Message instead of ScriptMessage. - Delete Tests/MgGraphDynamicParams.ps1, an unused DynamicParam snippet that nothing in the module or tests references.
Get-ScriptMessageConfig reported every failure as "Can't find the JSON configuration file" and told the caller to create one with Set-ScriptMessageConfigFilePath, which only stores the path. A missing file, a file that cannot be read, and a file that is not valid JSON now get separate messages that include the reason. Windows PowerShell 5.1's ConvertFrom-Json ends many of its messages with the entire input, which here is the configuration file and its secrets, so the parse error keeps only the reason in front of it. Measured in Research_Notes/PowerShell-Language-Behavior.md section 11.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Get-ScriptMessageConfig, whichConnect-ScriptMessageandSend-ScriptMessagealso use, now reports a missing file, an unreadable file, and invalid JSON separately, each with the reason. Every failure used to read "Can't find the JSON configuration file" and pointed atSet-ScriptMessageConfigFilePath, which only stores the path.ConvertFrom-Jsonthere ends many messages with the entire input, which is the configuration file and its secrets (Research_Notes/PowerShell-Language-Behavior.mdsection 11).AGENTS.md, the research notes (section 10), and two comments. The code already behaved this way.Minor:changelog entry about true/false settings, fixes the installed-module scratch script'sImport-Module, and deletes the unusedTests/MgGraphDynamicParams.ps1.Changelog: the
Minor:entry under Fixed about why a configuration file could not be used.