Operate the data (Intermediate)
Data Operations are critical routine administrative tasks and, with the release of Windows PowerShell Version 3.0, we have made some improvements regarding the handling of data in the console.
Getting ready
There are a few new operators introduced in PowerShell Version 3.0. For example, the In
and NotIn
operators.
How to do it...
Try executing the following code:
- The following command checks the availability of
1
in the reference set and returnsTrue
in this case:PS C :\> 1 -In (1,2,3) True
- The following command checks for an exact counter match for the
Admin
keyword in the reference set and returnsTrue
in this case:PS C :\> "Admin" -NotIn "Administrator" True
How it works...
The following table mentions the syntaxes ...
Get Instant Windows PowerShell Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.