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

Refactor Tests and Toolkit scripts to work on both PowerShell 7 and 5.1 #55

Closed
wants to merge 3 commits into from

Conversation

guirava
Copy link
Collaborator

@guirava guirava commented Mar 21, 2024

  • ignore Output.Release directory
  • Refactor Tests and Toolkit scripts to work on both PowerShell 7 and 5.1

sQuery = File.ReadAllText(_asPathString);
}
} catch (Exception) {
// ignore
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems like it would make debugging difficult

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the wanted behavior is: if the passed string is a filename, read from it, otherwise use it as is , so we don't actually want to handle this exception.
We didn't need the try catch in poewrshell 7, but we do for 5.1

@@ -49,6 +50,9 @@ Set-Location $PSScriptRoot\..
# Stop on error
$ErrorActionPreference = "Stop"

# Uncomment this to enable Write-Debug output
# $DebugPreference = "Continue"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would we be able to turn this into a parameter?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried lol
this is still confusing to me . -Debug is a standard cmdlet parameter, but it still needs the $DebugPreference to be set.

@guirava guirava closed this Mar 22, 2024
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.

3 participants