Skip to content
This repository has been archived by the owner on Oct 28, 2022. It is now read-only.

PowerNSX doesn't check if parameter is null or empty #612

Open
Nick-Andreev opened this issue Jan 16, 2020 · 1 comment
Open

PowerNSX doesn't check if parameter is null or empty #612

Nick-Andreev opened this issue Jan 16, 2020 · 1 comment

Comments

@Nick-Andreev
Copy link

PowerNSX doesn't validate if parameter is null or empty. So if I accidentally make a typo in the variable name, like so Get-NsxEdge -Name $publicEsgNmae, PowerNSX will treat empty value as a wildcard and retrieve all ESGs in the environment.

Typically cmdlets (like PowerCLI for example), will throw an error for an empty value:

Get-VDPortgroup : Cannot validate argument on parameter 'Name'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.

As a result of this, command like Get-NsxEdge -Name $publicEsgNmae | Remove-NsxEdge, may attempt to wipe out all ESGs from NSX.

Scary stuff.

@alagoutte
Copy link
Contributor

Yes good known... need to add to each cmdlet...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants