как запустить проверку выполнялся ли ранее этот скрипт на компью терах или нет?
<#
.PARAMETER Computer
This parameter can be used instead of the InputFile parameter to specify a single computer or a series of
computers using a comma-separated format
	
.PARAMETER Trustee
The SamAccount name of an AD User or AD Group that is to be added to the Local Administrators group

.EXAMPLE   
.\Add-PermAndShare.ps1 -Computer Server01 -Trustee JaapBrasser

Description:
Will set the the JaapBrasser account as a Local Administrator on Server01

.EXAMPLE   
.\Add-PermAndShare.ps1 -Computer 'Server01,Server02' -Trustee Contoso\HRManagers

Description:
Will set the HRManagers group in the contoso domain as Local Administrators on Server01 and Server02

.EXAMPLE   
.\Add-PermAndShare.ps1 -InputFile C:\ListofComputers.txt -Trustee User01

#>
param(
    [Parameter(ParameterSetName='InputFile')]
    [string]
        $InputFile,
    [Parameter(ParameterSetName='Computer')]
    [string]
        $Computer,
    [string]
        $Trustee
)
<#
.SYNOPSIS
    Function that resolves SAMAccount and can exit script if resolution fails
#>
function Resolve-SamAccount {
param(
    [string]
        $SamAccount,
    [boolean]
        $Exit
)
    process {
        try
        {
            $ADResolve = ([adsisearcher]"(samaccountname=$Trustee)").findone().properties['samaccountname']
        }
        catch
        {
            $ADResolve = $null
        }

        if (!$ADResolve) {
            Write-Warning "User `'$SamAccount`' not found in AD, please input correct SAM Account"
            if ($Exit) {
                exit
            }
        }
        $ADResolve
    }
}

if (!$Trustee) {
    $Trustee = Read-Host "Please input trustee"
}



if (!(Test-Path -Path $InputFile)) {
	Write-Warning "Input file not found, please enter correct path"
	exit
}
$import = import-csv -Path $InputFile -Delimiter ","
ForEach ($item in $import) {
	try {
	  	$ping=test-connection -ComputerName $item.comp -Quiet -Count 1
		if ($ping -eq $TRUE){
			$comp = $item.comp
			$session = New-PSSession -ComputerName $comp;
			Invoke-Command -Session $session -Args $comp,$Trustee -ScriptBlock {
				param([string]$comp,[string]$Trustee)
				$Paths = Get-WmiObject win32_userprofile |select localpath,sid|Where-Object {`
				$_.sid -notlike "S-1-5-21*1000"`
				-and $_.sid -notlike "S-1-5-21*1001"`
				-and $_.sid -notlike "S-1-5-21-4208031424-4290495700-3292227893-1118"`
				-and $_.sid -notlike "S-1-5-21-3899154156-1698218378-256410540-1176"`
				-and $_.sid -notlike "S-1-5-21-4208031424-4290495700-3292227893-1373"`
				-and $_.sid -notlike "S-1-5-21-4208031424-4290495700-3292227893-4280"`
				-and $_.sid -notlike "S-1-5-21-4208031424-4290495700-3292227893-1369"`
				-and $_.localpath -notlike "*admin*"`
				-and $_.localpath -notlike "*vastar*"`
				-and $_.localpath -notlike "*501st*"`
				-and $_.localpath -notlike "*links*"`
				-and $_.localpath -notlike "*Black*"`
				-and $_.localpath -notlike "*DonoR*"`
				-and $_.localpath -notlike "*mohax*"`
				-and $_.localpath -notlike "*Hazard*"`
				-and $_.localpath -notlike "*byakalex*"`
				-and $_.localpath -notlike "*USSR*"`
				-and $_.localpath -notlike "*tu-admin*"`
				-and $_.localpath -notlike "*Neko*"`
				-and $_.localpath -notlike "*C:\Windows*"}
				ForEach ($Path in $Paths) {
					$acl = Get-Acl $($Path.localpath);
					$accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule($Trustee,"Read","ContainerInherit,ObjectInherit","None","Allow");
					if ($accessRule -eq $null){
						Throw "Unable to create the Access Rule giving $Trustee";
					}
					$acl.SetAccessRule($accessRule)
					$acl | Set-Acl $($Path.localpath)
					#Write-Host -ForegroundColor Green "$($Path.localpath)"
				}
				$Share = Get-SmbShare Share$ -ErrorAction SilentlyContinue
				if ($Share -ne $null) {
					Remove-SmbShare "Share$" -Force
					New-SmbShare -Name "Share$" -Path c:\ -ReadAccess "$($Trustee)"| Out-Null
					Write-Host -ForegroundColor Green "Share recreated, ACL assigned on $comp"
				} else {
					New-SmbShare -Name "Share$" -Path c:\ -ReadAccess "$($Trustee)"| Out-Null
					Write-Host -ForegroundColor Green "Share created, ACL assigned on $comp"
				}
			}
			Remove-PSSession $session;
			} else {
				Write-Host -ForegroundColor Red "Computer $($item.comp) not available"
			}
	} catch {
		Write-Warning "$_"
	}
}