Powershell scripting1 - powershell

I am running this Script to get the directory listing
It was working few days ago but I keep having this error
New-PSSession : Cannot validate argument on parameter 'ComputerName'. The argument is null or empty.
Provide an argument that is not null or empty, and then try the command again.
At C:\DEV\Powershell3\directory-listing.ps1:11 char:38
+ $session=New-PSSession -ComputerName $servers
+ ~~~~~~~~
+ CategoryInfo : InvalidData: (:) [New-PSSession], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.NewPSSessionCommand
Invoke-Command : Cannot validate argument on parameter 'Session'. The argument is null or empty.
Provide an argument that is not null or empty, and then try the command again.
At C:\DEV\Powershell3\directory-listing.ps1:31 char:25
+ Invoke-Command -Session $session -ScriptBlock $scb
+ ~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Invoke-Command], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.InvokeCommandCommand
$servers=get-content C:\temp\servers.txt
$session=New-PSSession -ComputerName $servers
$scb = {
Write-host "working on $env:COMPUTERNAME" -ForegroundColor Red
$volumes=Get-WmiObject win32_volume -Filter "drivetype=3"
foreach($volume in $volumes) {
$driveletter=$volume.driveletter
if($driveLetter -ne $null) {
$drivename=$volume.name
(Get-ChildItem -path $drivename -Directory) |Select-Object Name,FullName
}
}
}
Invoke-Command -Session $session -ScriptBlock $scb

Related

Create folder on remote computer using PowerShell

The intention is to create a folder on a remote computer C drive.
I'm trying to run this:
$stageSvrs | %{
Invoke-Command -ComputerName $_ -ScriptBlock {
$setupFolder = "c:\Support\test1"
Write-Host "Creating Support Folder"
New-Item -Path $setupFolder -type directory -Force
Write-Host "Folder creation complete"
}
}
but I get the following error:
Invoke-Command : Cannot validate argument on parameter 'ComputerName'. The argument is null or empty.
Provide an argument that is not null or empty, and then try the command again.
At \\company.local\share\share\userdata\username\Documents\WindowsPowerShell\CreateFolder.ps1:2 char:39
+ Invoke-Command -ComputerName $_ -ScriptBlock {
+ ~~
+ CategoryInfo : InvalidData: (:) [Invoke-Command], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.InvokeCommandCommand

Add specific printer to multiple servers

I am new to powershell and would like to create a tool to add a single printer to multiple servers.
Here is my code so far:
$printer = read-host "Please enter the printer name"
$ip = read-host "Please enter the printer IP"
foreach ($server in #("NPARTS20SVR",
"NPARTS21SVR",
"NPARTS22SVR",
"NPARTS23SVR",
"NPARTS24SVR")) {
Add-PrinterPort -ComputerName $server -Name $ip -PrinterHostAddress $ip
Add-Printer -ComputerName $server -ConnectionName $printer -PortName $ip -Comment $ip
}
Here is the error I am getting:
Add-PrinterPort : An error occurred while performing the specified operation. See the error details for more
information.
At \\gogo\Software\HELP\NewBuild\PreDomain\Sham scripts\AddPrinterSVR.ps1:14 char:7
+ Add-PrinterPort -ComputerName $server -Name $ip -PrinterHostAdd ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (MSFT_PrinterPortTasks:ROOT/StandardCimv2/MSFT_PrinterPortTasks) [Add-Prin
terPort], CimException
+ FullyQualifiedErrorId : HRESULT 0x8007011b,Add-PrinterPort
Add-Printer : Parameter set cannot be resolved using the specified named parameters.
At \\gogo\Software\HELP\NewBuild\PreDomain\Sham scripts\AddPrinterSVR.ps1:15 char:7
+ Add-Printer -ComputerName $server -ConnectionName $printer -Por ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Add-Printer], ParameterBindingException
+ FullyQualifiedErrorId : AmbiguousParameterSet,Add-Printer

Powershell Force windows service that has dependency service to stop

I'm currently working on a powershell script to stop certain windows services and set its startup type to disabled.
My script works fine for services with status stopped however for services that has dependency service running cannot be stopped. I get bunch of errors. I tried to append -Force switch,it aint working too. What could be wrong.
Below is my script.
# Function defintion
function Shut_Services_Down {
# Services array
$services_to_shut_down = #("spooler", "XblGameSave", "Fax")
# Loop each service in the array
foreach ( $node in $services_to_shut_down ){
Set-Service -Name $node -Status stopped -StartupType Disabled -Force
}
}
# Call the function
Shut_Services_Down
error 1
Set-Service : A parameter cannot be found that matches parameter name 'Force'.
At C:\users\admin\desktop\psscripts\services.ps1:9 char:71
+ ... Set-Service -Name $node -Status stopped -StartupType Disabled -Force
+ ~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Set-Service], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.SetServiceCommand
Set-Service : A parameter cannot be found that matches parameter name 'Force'.
At C:\users\admin\desktop\psscripts\services.ps1:9 char:71
+ ... Set-Service -Name $node -Status stopped -StartupType Disabled -Force
+ ~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Set-Service], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.SetServiceCommand
Set-Service : A parameter cannot be found that matches parameter name 'Force'.
At C:\users\admin\desktop\psscripts\services.ps1:9 char:71
+ ... Set-Service -Name $node -Status stopped -StartupType Disabled -Force
+ ~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Set-Service], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.SetServiceCommand
error 2, after removing -Force switch
PS C:\users\admin\desktop\psscripts> .\services.ps1
Set-Service : Cannot stop service 'Print Spooler (spooler)' because it has dependent services.
At C:\users\admin\desktop\psscripts\services.ps1:9 char:9
+ Set-Service -Name $node -Status stopped -StartupType Disabled
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.ServiceProcess.ServiceController:ServiceController) [Set-Service], ServiceCommandException
+ FullyQualifiedErrorId : ServiceHasDependentServicesNoForce,Microsoft.PowerShell.Commands.SetServiceCommand
Solution
# Function defintion
function Shut_Services_Down {
# Services array
$services_to_shut_down = #("spooler", "XblGameSave", "Fax")
# Loop each service in the array
foreach ( $node in $services_to_shut_down )
{
Stop-Service -Name $node -Force -Confirm:$false
Set-Service -Name $node -Status stopped -StartupType Disabled
}
}
# Get-Service -Name "spooler" | Format-List -Property Name,DependentServices
# Call the function
Shut_Services_Down

Powershell Script - AD Discovery - Get-CimInstance : Access is denied. - SCCM 2012

I'm trying to create a powershell script to make AD Discovery possible, whenever i start te script i always get Get-CimInstance : Access is denied.
i also try to fill in the values of a Active Directory Container but the script always says that the property .Values cannot be found on this object.
what am i doing wrong ?
this is the full script:
Import-Module 'C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager'
Set-Location PS1:
# variable
$CMSiteCode = 'PS1'
$CMSiteServer = 'CM01.local.cursusdom.tm'
$CMNameSpace = "root\SMS\site_$CMSiteCode"
# create a schedule
$CMGroupDiscoverySchedule = New-CMSchedule -RecurInterval Days -RecurCount 7
# Forest Discovery
Set-CMDiscoveryMethod -ActiveDirectoryForestDiscovery ` -SiteCode $CMSiteCode ` -EnableActiveDirectorySiteBoundaryCreation $true ` -EnableSubnetBoundaryCreation $true ` -Enabled $true
# Configure Group Discovery
# Create the base discovery method using the schedule
Set-CMDiscoveryMethod -ActiveDirectoryGroupDiscovery ` -SiteCode $CMSiteCode ` -EnableDeltaDiscovery $true ` -DeltaDiscoveryIntervalMinutes 5 ` -EnableFilteringExpiredLogon $true ` -TimeSinceLastLogonDays 30 ` -EnableFilteringExpiredPassword $true ` -TimeSinceLastPasswordUpdateDays 90 ` -PollingSchedule $CMGroupDiscoverySchedule ` -Enabled $true
# AD containers
$ADGroupDiscovery = Get-CimInstance -ComputerName $CMSiteServer `
-Namespace $CMNameSpace `
-ClassName SMS_SCI_Component `
-Filter 'ComponentName ="SMS_AD_SECURITY_GROUP_DISCOVERY_AGENT"'
$ADContainerProp = $GroupDiscovery.PropLists | where {$_.PropertyListName -eq "AD Containers" }
$ADContainerProp.Values = "Acme - Software groups",0,0,1
$ADGroupDiscovery = Get-CimInstance -ComputerName $CMSiteServer ` -Namespace $CMNameSpace ` -ClassName SMS_SCI_Component ` -Filter 'ComponentName ="SMS_AD_SECURITY_GROUP_DISCOVERY_AGENT"'
$NewGroupProp = New-CimInstance -ClientOnly -Namespace $CMNameSpace -ClassName SMS_EmbeddedPropertyList -Property #{PropertyListName='Search Bases:PS1';Values=[string[]]'LDAP://OU=Software groups,OU=Acme,DC=Local,DC=cursusdom,DC=tm'}
$ADGroupDiscovery.PropLists += $NewGroupProp
# change back to the CIM instance
Get-CimInstance -ComputerName $CMSiteServer ` -Namespace $CMNameSpace ` -ClassName SMS_SCI_Component ` -Filter 'ComponentName ="SMS_AD_SECURITY_GROUP_DISCOVERY_AGENT"' | Set-CimInstance -Property #{PropLists=$ADGroupDiscovery.PropLists}
# Configure System Discovery
# polling schedule
$CMSystemDiscoverySchedule = New-CMSchedule -RecurInterval Days -RecurCount 1
# Create the base discovery method using the schedule
Set-CMDiscoveryMethod -ActiveDirectorySystemDiscovery ` -SiteCode $CMSiteCode ` -EnableDeltaDiscovery $true ` -DeltaDiscoveryIntervalMinutes 5 ` -EnableFilteringExpiredLogon $true ` -TimeSinceLastLogonDays 30 ` -EnableFilteringExpiredPassword $true ` -TimeSinceLastPasswordUpdateDays 90 ` -PollingSchedule $CMSystemDiscoverySchedule ` -Enabled $true
# AD containers
$ADSysDiscovery = Get-CimInstance -ComputerName $CMSiteServer `-Namespace $CMNameSpace ` -ClassName SMS_SCI_Component ` -Filter 'ComponentName ="SMS_AD_SYSTEM_DISCOVERY_AGENT"'
$ADContainerProp =$Sysdiscovery.PropLists | where {$_.PropertyListName -eq "AD Containers" }
$ADContainerProp.Values = "LDAP://OU=Domain Controllers,DC=local,DC=cursusdom,DC=tm",1,1 # Ldap path of the Container, Recursive search, Discover objects within groups
$ADContainerProp =$Sysdiscovery.PropLists | where {$_.PropertyListName -eq "AD Containers" }
$ADContainerProp.Values = "LDAP://OU=Computers,OU=Acme,DC=local,DC=cursusdom,DC=tm",1,1 # Ldap path of the Container, Recursive search, Discover objects within groups
# change back to the CIM instance
Get-CimInstance -ComputerName $CMSiteServer `
-Namespace $CMNameSpace `
-ClassName SMS_SCI_Component `
-Filter 'ComponentName ="SMS_AD_SYSTEM_DISCOVERY_AGENT"' | Set-CimInstance -Property #{PropLists=$ADSysDiscovery.PropLists}
# User Discovery
# polling schedule
$CMUserDiscoverySchedule = New-CMSchedule -RecurInterval Days -RecurCount 1
# Create the base discovery method
Set-CMDiscoveryMethod -ActiveDirectoryUserDiscovery `
-SiteCode $CMSiteCode `
-EnableDeltaDiscovery $true `
-DeltaDiscoveryIntervalMinutes 5 `
-PollingSchedule $CMUserDiscoverySchedule `
-enabled $true
# AD containers
$ADUserDiscovery = Get-CimInstance -ComputerName $CMSiteServer `
-Namespace $CMNameSpace `
-ClassName SMS_SCI_Component `
-Filter 'ComponentName ="SMS_AD_USER_DISCOVERY_AGENT"'
$ADUserContainers = $ADUserDiscovery.PropLists | Where-Object {$_.PropertyListName -eq 'AD Containers'}
$ADContainerProp.Values = "LDAP://OU=Users,OU=Acme,DC=local,DC=cursusdom,DC=tm",0,0
$ADContainerProp.Values = "LDAP://OU=Admins,OU=Acme,DC=local,DC=cursusdom,DC=tm",0,0
# change back to the CIM instance
Get-CimInstance -ComputerName $CMSiteServer `
-Namespace $CMNameSpace `
-ClassName SMS_SCI_Component `
-Filter 'ComponentName ="SMS_AD_USER_DISCOVERY_AGENT"' | Set-CimInstance -Property #{PropLists=$ADUserDiscovery.PropLists}
# 5.0 - Restart SMS_SITE_COMPONENT_MANAGER Service to apply changes
Get-Service -ComputerName $CMSiteServer -Name SMS_SITE_COMPONENT_MANAGER | Restart-Service
these are the errors i'm getting:
PS C:\Users\Admin> C:\Users\Admin\Downloads\AD discovery.ps1
Get-CimInstance : Access is denied.
At C:\Users\Admin\Downloads\AD discovery.ps1:34 char:21
+ $ADGroupDiscovery = Get-CimInstance -ComputerName $CMSiteServer `
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (:) [Get-CimInstance], CimException
+ FullyQualifiedErrorId : HRESULT 0x80070005,Microsoft.Management.Infrastructure.CimCmdlets.GetCimInstanceCommand
+ PSComputerName : CM01.local.cursusdom.tm
The property 'Values' cannot be found on this object. Verify that the property exists and can be set.
At C:\Users\Admin\Downloads\AD discovery.ps1:40 char:1
+ $ADContainerProp.Values = "Acme - Software groups",0,0,1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertyNotFound
Get-CimInstance : Access is denied.
At C:\Users\Admin\Downloads\AD discovery.ps1:43 char:21
+ ... Discovery = Get-CimInstance -ComputerName $CMSiteServer ` -Namespa ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (:) [Get-CimInstance], CimException
+ FullyQualifiedErrorId : HRESULT 0x80070005,Microsoft.Management.Infrastructure.CimCmdlets.GetCimInstanceCommand
+ PSComputerName : CM01.local.cursusdom.tm
The property 'PropLists' cannot be found on this object. Verify that the property exists and can be set.
At C:\Users\Admin\Downloads\AD discovery.ps1:47 char:1
+ $ADGroupDiscovery.PropLists += $NewGroupProp
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertyNotFound
Get-CimInstance : Access is denied.
At C:\Users\Admin\Downloads\AD discovery.ps1:51 char:1
+ Get-CimInstance -ComputerName $CMSiteServer ` -Namespace $CMNameSp ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (:) [Get-CimInstance], CimException
+ FullyQualifiedErrorId : HRESULT 0x80070005,Microsoft.Management.Infrastructure.CimCmdlets.GetCimInstanceCommand
+ PSComputerName : CM01.local.cursusdom.tm
Get-CimInstance : A positional parameter cannot be found that accepts argument '-Namespace'.
At C:\Users\Admin\Downloads\AD discovery.ps1:74 char:19
+ ... Discovery = Get-CimInstance -ComputerName $CMSiteServer `-Namespace $ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Get-CimInstance], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.Management.Infrastructure.CimCmdlets.GetCimInstan
ceCommand
The property 'Values' cannot be found on this object. Verify that the property exists and can be set.
At C:\Users\Admin\Downloads\AD discovery.ps1:77 char:1
+ $ADContainerProp.Values = "LDAP://OU=Domain Controllers,DC=local,DC=c ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertyNotFound
The property 'Values' cannot be found on this object. Verify that the property exists and can be set.
At C:\Users\Admin\Downloads\AD discovery.ps1:80 char:1
+ $ADContainerProp.Values = "LDAP://OU=Computers,OU=Acme,DC=local,DC=cu ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertyNotFound
Get-CimInstance : Access is denied.
At C:\Users\Admin\Downloads\AD discovery.ps1:84 char:1
+ Get-CimInstance -ComputerName $CMSiteServer `
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (:) [Get-CimInstance], CimException
+ FullyQualifiedErrorId : HRESULT 0x80070005,Microsoft.Management.Infrastructure.CimCmdlets.GetCimInstanceCommand
+ PSComputerName : CM01.local.cursusdom.tm
Get-CimInstance : Access is denied.
At C:\Users\Admin\Downloads\AD discovery.ps1:110 char:20
+ $ADUserDiscovery = Get-CimInstance -ComputerName $CMSiteServer `
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (:) [Get-CimInstance], CimException
+ FullyQualifiedErrorId : HRESULT 0x80070005,Microsoft.Management.Infrastructure.CimCmdlets.GetCimInstanceCommand
+ PSComputerName : CM01.local.cursusdom.tm
The property 'Values' cannot be found on this object. Verify that the property exists and can be set.
At C:\Users\Admin\Downloads\AD discovery.ps1:117 char:1
+ $ADContainerProp.Values = "LDAP://OU=Users,OU=Acme,DC=local,DC=cursus ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertyNotFound
The property 'Values' cannot be found on this object. Verify that the property exists and can be set.
At C:\Users\Admin\Downloads\AD discovery.ps1:119 char:1
+ $ADContainerProp.Values = "LDAP://OU=Admins,OU=Acme,DC=local,DC=cursu ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertyNotFound
Get-CimInstance : Access is denied.
At C:\Users\Admin\Downloads\AD discovery.ps1:124 char:1
+ Get-CimInstance -ComputerName $CMSiteServer `
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (:) [Get-CimInstance], CimException
+ FullyQualifiedErrorId : HRESULT 0x80070005,Microsoft.Management.Infrastructure.CimCmdlets.GetCimInstanceCommand
+ PSComputerName : CM01.local.cursusdom.tm
Restart-Service : Service 'SMS_SITE_COMPONENT_MANAGER (SMS_SITE_COMPONENT_MANAGER)' cannot be stopped due to the follo
wing error: Cannot open SMS_SITE_COMPONENT_MANAGER service on computer 'CM01.local.cursusdom.tm'.
At C:\Users\Admin\Downloads\AD discovery.ps1:131 char:76
+ ... Name $CMSiteServer -Name SMS_SITE_COMPONENT_MANAGER | Restart-Service
+ ~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (System.ServiceProcess.ServiceController:ServiceController) [Restart-Servic
e], ServiceCommandException
+ FullyQualifiedErrorId : CouldNotStopService,Microsoft.PowerShell.Commands.RestartServiceCommand
PS PS1:\>
Could anyone help me ? :) i'm still trying to learn powershell.
thanks

powershell get-content path null error

$commonElementsLocation = ((Get-Location).Path + "\FolderMatchingCommonWords.txt")
if ($commonElementsLocation) {
$result += Start-Job -InitializationScript {
$commonElements = Get-Content -Path $commonElementsLocation
} -ScriptBlock $testScriptBlock -ArgumentList "testing" | Wait-Job | Receive-Job
}
Not sure what I am doing wrong here - probably a stupid mistake, but I put a condition around the Start-Job statement, and powershell still gives the following error:
Get-Content : Cannot bind argument to parameter 'Path' because it is null.
At line:1 char:39
+ $commonElements = (Get-Content -Path $commonElementsLocation)
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Get-Content], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.GetContentC
ommand
Running startup script threw an error: Cannot bind argument to parameter 'Path' because it is null..
+ CategoryInfo : OpenError: (localhost:String) [], RemoteException
+ FullyQualifiedErrorId : PSSessionStateBroken
In v3 add $using:
....(Get-Content -Path $using:commonElementsLocation...
You have already used a variable for a script block once with $testScriptBlock. You could just do that again for -InitializationScript?
$anotherSB = [scriptblock]::create("$commonElements = (Get-Content -Path $commonElementsLocation)")
$result += Start-Job -InitializationScript $anotherSB -ScriptBlock $testScriptBlock -ArgumentList "testing" | Wait-Job | Receive-Job