Skip to content

Instantly share code, notes, and snippets.

@leblocks
leblocks / Watch-Files.ps1
Last active February 2, 2024 18:18
multi file tail for powershell core
<#
.SYNOPSIS
Watches text files for changes and prints the specified number of lines from the end of the file.
.DESCRIPTION
This function monitors a set of text files for changes and prints the content to the console.
Each line printed is prefixed by the filename.
.PARAMETER Paths
An array of paths to text files to monitor. This parameter is mandatory.
#! /bin/bash
set -x # enable trace
set -e # enable exit on first error
KUBESPRAY_VERSION=2.18.0
YQ_VERSION=4.15.1
# validate that all needed variables were passed from orch script
while read -r env_var; do