I made a few one-liners for cmd using net commands for viewing, unlocks, resets, extensions and such. For example:
net user /domain %1 /expires:%2 /active:yes
My one problem was doing a decent search. I love PS for get-aduser but my usual trick for %1 to pass the usernames… I don’t know how to do this in PS. I’m basically learning by examples as i get an idea or run into a problem. Any advice for how i could pass something like the below where %1 %2 and such are entered following my new-alias for the search command?
get-aduser -filter 'name -like "%1"'
submitted by /u/sadepanda
[link] [comments]
The post What’s the PS equivalent of %1 used in CMD? appeared first on How to Code .NET.