Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 8583

Going Further with ForEach

$
0
0

In "Introducing the Pipeline and ForEach" and "From One-Liner to ForEach One-Liner," I've shown you how the ForEach cmdlet and the pipeline variable $_ together let you write simple one-liners in a different way. For example, suppose bigfirm.com has an organizational unit (OU) called Machinists, and you want to change the description attribute of every user account to the text Machinist. (Yes, it’s a trivial example, but it's also easy to understand.) You could do that with this simple one-liner, of the kind that I discussed a dozen or more columns ago in "Find Users with Get-ADUser":

Read More

 


Viewing all articles
Browse latest Browse all 8583

Trending Articles