Powershell template

From roonics
Revision as of 11:49, 5 April 2024 by Jlambert (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Basic template for use when creating a script:

<#
.SYNOPSIS

.DESCRIPTION

.EXAMPLE

.OUTPUTS

.NOTES

#>

# SET DATE FORMAT
$DateTime = $(get-date -f yyyy-MM-dd_HH-mm-ss)

# START TRANSCRIPT LOGGING
Start-Transcript -Path "log_$DateTime.txt" -Append



Write-Host "Script stuff here"



# STOP TRANSCRIPT LOGGING
Stop-Transcript