Joining two scripts
<p>First I made new script that make regex :</p>

<pre><code>$input_path = 'C:\site-download\input.txt'
$output_file = 'C:\site-download\output.txt'
$regex = '(?&lt;month&gt;VPIP&lt;\/span&gt;&lt;span class=""right""&gt;\d{2}.\d{1})'
$regex2 = '(?&lt;month&gt;Winrate&lt;\/span&gt;&lt;span class=""right""&gt;\d{1}.\d{1})'
$regex3 = '(?&lt;month&gt;PFR&lt;\/span&gt;&lt;span class=""right""&gt;\d{2}.\d{1})'
$regex4 = '(?&lt;month&gt;Winnings&lt;\/span&gt;&lt;span class=""right""&gt;\-[0-9]{1,9})'
$regex5 = '(?&lt;month&gt;3Bet&lt;\/span&gt;&lt;span class=""right""&gt;\d{1}.\d{1})'

Select-String -Path $input_path -Pattern $regex -List | % { $_.Matches} | % { $_.Value } | Foreach-Object {$_ -replace '&lt;/span&gt;&lt;span class=""right""&gt;', ' = '} | Add-Content $output_file
Select-String -Path $input_path -Pattern $regex2 -List | % { $_.Matches} | % { $_.Value } |Foreach-Object {$_ -replace '&lt;/span&gt;&lt;span class=""right""&gt;', ' = '} | Add-Content $output_file
Select-String -Path $input_path -Pattern $regex3 -List | % { $_.Matches} | % { $_.Value } | Foreach-Object {$_ -replace '&lt;/span&gt;&lt;span class=""right""&gt;', ' = '} | Add-Content $output_file
Select-String -Path $input_path -Pattern $regex4 -List | % { $_.Matches} | % { $_.Value } |Foreach-Object {$_ -replace '&lt;/span&gt;&lt;span class=""right""&gt;', ' = '} | Add-Content $output_file
Select-String -Path $input_path -Pattern $regex5 -List | % { $_.Matches} | % { $_.Value } | Foreach-Object {$_ -replace '&lt;/span&gt;&lt;span class=""right""&gt;', ' = '} | Add-Content $output_file
</code></pre>

<p>Its working good so far.</p>

<p>Second script I found in web (also working good): </p>

<pre><code>Function Register-Watcher {
    param ($folder)
    $filter = "*.*" #all files
    $watcher = New-Object IO.FileSystemWatcher $folder, $filter -Property @{ 
        IncludeSubdirectories = $false
        EnableRaisingEvents = $true
    }

    $changeAction = [scriptblock]::Create('
        # This is the code which will be executed every time a file change is detected
        $path = $Event.SourceEventArgs.FullPath
        $name = $Event.SourceEventArgs.Name
        $changeType = $Event.SourceEventArgs.ChangeType
        $timeStamp = $Event.TimeGenerated
        Write-Host "The file $name was $changeType at $timeStamp"
    ')

    Register-ObjectEvent $Watcher "Changed" -Action $changeAction
}

Register-Watcher "C:\site-download"
</code></pre>

<p>So basically I'm working to find out how I can add first script to second.
I tried something this:</p>

<pre><code>Function Register-Watcher {
    param ($folder)
    $filter = "*.*" #all files
    $watcher = New-Object IO.FileSystemWatcher $folder, $filter -Property @{ 
        IncludeSubdirectories = $false
        EnableRaisingEvents = $true
    }

    $changeAction = [scriptblock]::Create('
        # This is the code which will be executed every time a file change is detected
        $path = $Event.SourceEventArgs.FullPath
        $name = $Event.SourceEventArgs.Name
        $changeType = $Event.SourceEventArgs.ChangeType
        $timeStamp = $Event.TimeGenerated
        Write-Host "The file $name was $changeType at $timeStamp"

        $input_path = $name
        $output_file = 'C:\site-download\output.txt'
        $regex = '(?&lt;month&gt;VPIP&lt;\/span&gt;&lt;span class=""right""&gt;\d{2}.\d{1})'
        $regex2 = '(?&lt;month&gt;Winrate&lt;\/span&gt;&lt;span class=""right""&gt;\d{1}.\d{1})'
        $regex3 = '(?&lt;month&gt;PFR&lt;\/span&gt;&lt;span class=""right""&gt;\d{2}.\d{1})'
        $regex4 = '(?&lt;month&gt;Winnings&lt;\/span&gt;&lt;span class=""right""&gt;\-[0-9]{1,9})'
        $regex5 = '(?&lt;month&gt;3Bet&lt;\/span&gt;&lt;span class=""right""&gt;\d{1}.\d{1})'

        Select-String -Path $input_path -Pattern $regex -List | % { $_.Matches} | % { $_.Value } | Foreach-Object {$_ -replace '&lt;/span&gt;&lt;span class=""right""&gt;', ' = '} | Add-Content $output_file
        Select-String -Path $input_path -Pattern $regex2 -List | % { $_.Matches} | % { $_.Value } |Foreach-Object {$_ -replace '&lt;/span&gt;&lt;span class=""right""&gt;', ' = '} | Add-Content $output_file
        Select-String -Path $input_path -Pattern $regex3 -List | % { $_.Matches} | % { $_.Value } | Foreach-Object {$_ -replace '&lt;/span&gt;&lt;span class=""right""&gt;', ' = '} | Add-Content $output_file
        Select-String -Path $input_path -Pattern $regex4 -List | % { $_.Matches} | % { $_.Value } |Foreach-Object {$_ -replace '&lt;/span&gt;&lt;span class=""right""&gt;', ' = '} | Add-Content $output_file
        Select-String -Path $input_path -Pattern $regex5 -List | % { $_.Matches} | % { $_.Value } | Foreach-Object {$_ -replace '&lt;/span&gt;&lt;span class=""right""&gt;', ' = '} | Add-Content $output_file
    ')

    Register-ObjectEvent $Watcher "Changed" -Action $changeAction
}

Register-Watcher "C:\site-download"
</code></pre>

<p>But keep getting some errors:</p>

<pre>Select-String : Cannot bind argument to parameter 'Path' because it is null.
At line:1 char:21
+ select-string -Path $input_path -Pattern $regex -List | % { $_.Matches} | % { $_ ...
+                     ~~~~~~~~~~~
    + CategoryInfo : InvalidData: (:) [Select-String], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.Sel‌​ectStringCommand</pre>

<p>Can someone help me out to fix this last script?</p>