Skip to content

Conversation

@calcobia
Copy link

This PR closes #

The changes in this PR are as follows:

  • Fixed null variable checks in Set-ToolsRepo function.
  • Improved version check with semantic version comparison instead of lexicographical comparison.
  • Fixed path error that prevented files from being copied.
  • Additional error handling
  • General formatting

I have read the contributor guidelines and have completed the following:

  • Formatted the code using VSCode default formatter for PowerShell.
  • Tested the code end-to-end against an SDDC.
  • Documented the functions using standard PowerShell markup and applied AVSAttribute to newly exported functions.

Fixed version check by replacing an unsupported ternary conditional operator with the equivalent if statement.
Fixed the path error that would cause the files to not be copied.
Copy link
Author

@calcobia calcobia left a comment

Choose a reason for hiding this comment

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

Before - A simple string comparison

$OldVersion = "10.9.30"
$NewVersion = "10.10.30"
If ($NewVersion -ge $OldVersion) {"New version is newer."} else {"New version is older"}
New version is older
Returns the wrong result.

Now - Semantic version comparison

$OldVersion = [System.Version]::Parse("10.9.30")
$NewVersion = [System.Version]::Parse("10.10.30")
If ($NewVersion -ge $OldVersion) {"New version is newer."} else {"New version is older"}
New version is newer.
Returns the correct result.

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.

1 participant