Month: June 2018

Progress On ‘Invoke-Remote’

Yup, it’s been a while since I had time to work on my little side-project “Invoke-Remote” – it’s a small collection of scripts that aims to enhance my everyday workflow with remote Windows environments.
Today I finally managed to add a missing piece: Get-RemoteFileContent.ps1 (ir-get for the lazy)
This script utilizes IO.FileSystemWatcher in order to make it possible to WAIT until a file is being created on a remote host! 🙂
(comes in handy when waiting for a certain log, lock or sync file)

param($folder, $file)
$fullpath = Join-Path $folder $file
if (-Not (Test-Path $fullpath)) {
  $env:RF_FILE_CREATED_INDICATOR = $false
  $fsw = New-Object IO.FileSystemWatcher $folder, $file -Property @{IncludeSubdirectories = $false; NotifyFilter = [IO.NotifyFilters]'FileName, LastWrite'};
  $j = Register-ObjectEvent $fsw Created -SourceIdentifier FileCreated -Action {
  $env:RF_FILE_CREATED_INDICATOR = $true
};
while ($env:RF_FILE_CREATED_INDICATOR -eq $false) {
  Start-Sleep -Milliseconds 1000;
};
  $j = $fsw.Dispose();
  $j = Unregister-Event FileCreated
}
Get-Content $fullpath

Links:

A Quick Trip To Innervillgraten

From Wikipedia: “Innervillgraten is a municipality in the district of Lienz in the Austrian state of Tyrol. The region is one of the most remote regions in Austria.” (https://en.wikipedia.org/wiki/Innervillgraten)

The thing is: it’s not only one of the most remote, it’s also one of the most beautiful and original places Austria has to offer 🙂

find it on Google maps: https://www.google.com/maps/place/Innervillgraten

Innervillgraten’s website: http://www.innervillgraten.at/