Lerch Web Wiki

Random, erratic, no responsibility is taken for the correctness of this information

User Tools

Site Tools


powershell:basics:functions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
powershell:basics:functions [2017/02/23 13:32]
marcus
powershell:basics:functions [2017/02/23 13:32]
marcus
Line 3: Line 3:
 <code powershell Log2File.ps1> <code powershell Log2File.ps1>
 function Log2File{ function Log2File{
- param( +    param( 
- [string]$log, + [string]$log, 
- [string]$text + [string]$text 
-+    
- "$(Get-Date -Format "yyyyMMdd-HH:mm:ss"):`t$text" | Out-File -FilePath $log -Append+    "$(Get-Date -Format "yyyyMMdd-HH:mm:ss"):`t$text" | Out-File -FilePath $log -Append
     Write-Verbose "$(Get-Date -Format "yyyyMMdd-HH:mm:ss"):`t$text"      Write-Verbose "$(Get-Date -Format "yyyyMMdd-HH:mm:ss"):`t$text" 
 } }
powershell/basics/functions.txt · Last modified: 2020/03/24 09:01 (external edit)