Is Powershell Polymorphic?

I would like to write some functions that take one parameter, which can vary the type without using a whole new function.

For example, for SQL, I would like to either accept the text string of the sql command or a file. or the path or adsi object will be selected for the active directory

unlock-aduser [adsi]"LDAP://dn=..." or unlock-aduser [string]"LDAP://dn=..."

will work just as well.

+4
source share
2 answers

Just no no.

However you should take a look here for parameter parameters

+5
source

Source: https://habr.com/ru/post/1341829/


All Articles