I want to create a few PowerShell functions that create an item, or return existing item if it is already there. E.g. database login, folder, etc.
What is a proper verb for this? There is no
Ensure in Approved Verbs, and I am not sure what else would be applicable. I considered
New-X -IfExists ReturnExisting but I would prefer to follow a common pattern instead of inventing my own.
Are there any built-in PowerShell commandlets that do get-or-create so that I can copy the approach?
Per the approved verb listing:
New vs. Set
The New verb is used to create a new resource. The Set verb is used to modify an existing resource, optionally creating the resource if it does not exist, such as the Set-Variable cmdlet.