Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function ListRunningServices
- {
- $services+= Get-Service | ?{$_.Status -eq "Running"} | sort Name | select Name;
- }
- $services = @();
- ListRunningServices;
- $services;
- Function ListRunningServices {
- Get-Service | ?{$_.Status -eq "Running"} | sort Name | select Name
- }
- $services = ListRunningServices
- $services
- Function ListRunningServices {
- $global:services = Get-Service | ?{$_.Status -eq "Running"} | sort Name | select Name
- }
- $services = @()
- ListRunningServices
- $services
- Function ListRunningServices
- {
- Get-Service | ?{$_.Status -eq "Running"} | sort Name | select Name |
- ForEach-Object {$services.add($_)}
- }
- $services = New-Object collections.arraylist
- ListRunningServices
- $services
- Function ListRunningServices
- {
- $services = @()
- $services+= Get-Service | ?{$_.Status -eq "Running"} | sort Name | select Name;
- return $services
- }
- $services = ListRunningServices
- $services
- Function ListRunningServices
- {
- $global:services+= Get-Service | ?{$_.Status -eq "Running"} | sort Name | select Name;
- }
- $services = @();
- ListRunningServices;
- $services;
- # Visible everywhere inside the script file (f.ex: myNameScript.ps1)
- $script:names = @()
- Function AddStringToArray ([string]$i_name) {
- $script:nam += $i_name
- }
- AddStringToArray -i_name "Markie"
- AddStringToArray -i_name "Harry"
Add Comment
Please, Sign In to add comment