Microsoft Windows PowerShell 3.0 First Look by 2012

Microsoft Windows PowerShell 3.0 First Look by 2012

Author:2012
Language: eng
Format: epub
Publisher: Packt Publishing


The following workflow iterates over the lines within the text file and outputs them in parallel:

PS C:\> workflow Get-User { $lines = Get-Content –FilePath C:\UserNames.txt foreach —parallel ($line in $lines) { if ($line —match “mdnvdi”) { “User: $line” } } } PS C:\> Get-User

Running the workflow will yield different results depending on the size of the file, but in theory, any line could be output because the loop is executing in parallel. Parallel execution is very powerful but must be used with caution and in the right circumstances. Workflows makes it very easy to create parallel activities.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.