Initialer Import der Synology Scripts
This commit is contained in:
Executable
+25
@@ -0,0 +1,25 @@
|
||||
function New-LogFile {
|
||||
param($LogPath)
|
||||
|
||||
```
|
||||
if (!(Test-Path $LogPath)) {
|
||||
New-Item -ItemType Directory -Path $LogPath | Out-Null
|
||||
}
|
||||
|
||||
return Join-Path $LogPath ("Shutdown_{0}.log" -f (Get-Date -Format "yyyy-MM-dd_HH-mm-ss"))
|
||||
```
|
||||
|
||||
}
|
||||
|
||||
function Write-Log {
|
||||
param(
|
||||
[string]$Message,
|
||||
[string]$Level = "INFO"
|
||||
)
|
||||
|
||||
```
|
||||
$line = "[{0}] {1}" -f $Level, $Message
|
||||
Write-Host $line
|
||||
```
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user