Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $search_param = read-host "Enter search string: "
- $search_param = "*" + $search_param + "*" # Construct search param.
- $search_result = Get-ADUser -Filter {Surname -like $search_param -or GivenName -like $search_param -or SamAccountName -like $search_param}
- $search_result | format-table -Property GivenName,Surname,SamAccountName
- $index=0
- Get-Process | Format-Table -Property @{name="index";expression={$global:index;$global:index+=1}},name,handles
- $procs = Get-Process
- #option 1
- $procs | Select @{N='Index'; E={$procs.IndexOf($_)}}, name, handles
- #option 2
- $procs | Format-Table -Property @{name="index";expression={$procs.IndexOf($_)}},name,handles
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement