@@ -1744,17 +1744,17 @@ Function Update-LTService{
1744
1744
}# End End
1745
1745
}# End Function Update-LTService
1746
1746
1747
- Function Get-LTError {
1747
+ Function Get-LTErrors {
1748
1748
<#
1749
1749
. SYNOPSIS
1750
1750
This will pull the %ltsvcdir%\LTErrors.txt file into an object.
1751
1751
1752
1752
. EXAMPLE
1753
- Get-LTError | where {(Get-date $_.Time) -gt (get-date).AddHours(-24)}
1753
+ Get-LTErrors | where {(Get-date $_.Time) -gt (get-date).AddHours(-24)}
1754
1754
Get a list of all errors in the last 24hr
1755
1755
1756
1756
. EXAMPLE
1757
- Get-LTError | Out-Gridview
1757
+ Get-LTErrors | Out-Gridview
1758
1758
Open the log file in a sortable searchable window.
1759
1759
1760
1760
. NOTES
@@ -1771,7 +1771,7 @@ Function Get-LTError{
1771
1771
Purpose/Change: Changed Erroraction from Stop to unspecified to allow caller to set the ErrorAction.
1772
1772
1773
1773
Update Date: 1/26/2019
1774
- Purpose/Change: Update for better international date parsing support
1774
+ Purpose/Change: Update for better international date parsing support. Function rename.
1775
1775
1776
1776
. LINK
1777
1777
http://labtechconsulting.com
@@ -1788,12 +1788,12 @@ Function Get-LTError{
1788
1788
1789
1789
Process {
1790
1790
if ($ (Test-Path - Path " $BasePath \LTErrors.txt" ) -eq $False ) {
1791
- Write-Error " ERROR: Line $ ( LINENUM) : Unable to find log ."
1791
+ Write-Error " ERROR: Line $ ( LINENUM) : Unable to find lelog ."
1792
1792
return
1793
1793
}
1794
1794
Try {
1795
1795
$errors = Get-Content " $BasePath \LTErrors.txt"
1796
- $errors = $errors -join ' ' -split ' :::'
1796
+ $errors = $errors -join ' ' -split ' ::: '
1797
1797
foreach ($Line in $Errors ){
1798
1798
$items = $Line -split " `t " -replace ' - ' , ' '
1799
1799
if ($items [1 ]){
@@ -1818,7 +1818,8 @@ Function Get-LTError{
1818
1818
Else {$Error [0 ]}
1819
1819
Write-Debug " Exiting $ ( $myInvocation.InvocationName ) at line $ ( LINENUM) "
1820
1820
}# End End
1821
- }# End Function Get-LTError
1821
+ }# End Function Get-LTErrors
1822
+ Set-Alias - Name Get-LTError - Value Get-LTErrors
1822
1823
1823
1824
Function Reset-LTService {
1824
1825
<#
@@ -2518,7 +2519,7 @@ Function Get-LTProbeErrors{
2518
2519
return
2519
2520
}
2520
2521
$errors = Get-Content " $BasePath \LTProbeErrors.txt"
2521
- $errors = $errors -join ' ' -split ' :::'
2522
+ $errors = $errors -join ' ' -split ' ::: '
2522
2523
Try {
2523
2524
Foreach ($Line in $Errors ){
2524
2525
$items = $Line -split " `t " -replace ' - ' , ' '
@@ -3538,7 +3539,7 @@ Function Initialize-LTServiceModule{
3538
3539
$PublicFunctions = @ (((@"
3539
3540
ConvertFrom-LTSecurity
3540
3541
ConvertTo-LTSecurity
3541
- Get-LTError
3542
+ Get-LTErrors
3542
3543
Get-LTLogging
3543
3544
Get-LTProbeErrors
3544
3545
Get-LTProxy
@@ -3564,6 +3565,7 @@ Update-LTService
3564
3565
"@ ) -replace " [`r`n ,\s]+" , ' ,' ) -split ' ,' )
3565
3566
3566
3567
$PublicAlias = @ (((@"
3568
+ Get-LTError
3567
3569
ReInstall-LTService
3568
3570
"@ ) -replace " [`r`n ,\s]+" , ' ,' ) -split ' ,' )
3569
3571
0 commit comments