Skip to content

Instantly share code, notes, and snippets.

@schittli
Last active February 6, 2022 15:10
Show Gist options
  • Save schittli/8cbb45656d1ea980fbdd773a7d8aeebd to your computer and use it in GitHub Desktop.
Save schittli/8cbb45656d1ea980fbdd773a7d8aeebd to your computer and use it in GitHub Desktop.
LibGist: Ex-LibGist-Usage.ps1 #PowerShell #LibGist
# Beispiel Script,
# um LibGist Funktionen einzubinen
#
# 001, 220127, tom@jig.ch
#
Param(
[Switch]$LibGistForceUpdate
)
### Config
$LibGistVersion_Ex_LibGist_Usage_ps1 = '001'
## !! LibGist
# Scriptname für Use-Gists berechnen
$LibGistUseGists_ps1 = 'LibGist-Use-Gists.ps1'
$ScriptDir = [IO.Path]::GetDirectoryName($MyInvocation.MyCommand.Path)
$LibGistUseGists_ps1 = Join-Path $ScriptDir $LibGistUseGists_ps1
# Use-Gists einbinden
. $LibGistUseGists_ps1
# Allenfalls alle lokalen LibGist Files aktualisieren
$ResUpdate = LibGist-Update-GistFiles -Now:$LibGistForceUpdate
If ($LibGistForceUpdate) {
Break Script
}
# Wenn das Script selber aktualisiert wurde, es neu laden
If ($ResUpdate) { . $LibGistUseGists_ps1 }
# Alle lokalen LibGist Files als Funktionen einbinden
. LibGist-Load-Gists
## Prepare
## Main
# Testen einer LibGist Funktion
Log 0 "Ping 9.9.9.9"
Log 1 (Test-Connection-Fast 9.9.9.9 -TimeoutMs 500 -TestForSuccess -NoOfPings 3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment