Private/_MyTemplate.ps1
|
function MyTemplate { ################################################################################ ##### ##### ##### Description ###### ##### ##### ################################################################################ Param( [Parameter(Mandatory)] [string] $Server, [string] $param2 ) $logo = @' █████╗ ███████╗██████╗ ██████╗ ██╔══██╗██╔════╝╚════██╗██╔════╝ ██████╗ ███████║███████╗ █████╔╝██║ ███╗██╔═══██╗ ██╔══██║╚════██║██╔═══╝ ██║ ██║██║ ██║ ██║ ██║███████║███████╗╚██████╔╝╚██████╔╝ ╚═╝ ╚═╝╚══════╝╚══════╝ ╚═════╝ ╚═════╝ '@ -split "`n" $logo | ForEach-Object { $line = $_ -replace '█', '█' Write-Host $line -ForegroundColor Yellow -BackgroundColor Black } $CurrentFunction = Get-FunctionName Write-Log -Message "### Start Function $CurrentFunction ###" $StartRunTime = (Get-Date).ToString($Script:DateFormatLog) #################### main code | out- host ##################### #<neuer code> # @{N = 'whencreated'; E = { Convert-FromUnixTime -seconds $_.whencreated -objectType 'User' -type 'whencreated' } } Write-Log -Message " >> using " ######################## main code ############################ $runtime = Get-RunTime -StartRunTime $StartRunTime Write-Log -Message " Run Time: $runtime [h] ###" Write-Log -Message "### End Function $CurrentFunction ###" return $true } |