From ca2b0b1ab605ba6f9b1e6797492831b4c2b15d74 Mon Sep 17 00:00:00 2001 From: "James Truher [MSFT]" Date: Wed, 28 Jun 2023 10:26:12 -0700 Subject: [PATCH] Add ConvertFrom-TextTable cmdlet (#33) * Initial commit of text table converter with tests. * Address feedback in PR #29 (now closed). Change name to ConvertFrom-TextTable. Remove Preview tag (since we're still a 0.x version). Change Convert parameter To ConvertPropertyValue, Typename to TypeName. --- .gitignore | 2 +- build.ps1 | 26 + src/Microsoft.PowerShell.TextUtility.psd1 | 7 +- .../Microsoft.PowerShell.TextUtility.csproj | 3 + src/code/TextTableParser.cs | 453 ++++++++++ test/CompareText.tests.ps1 | 99 ++- test/TextTableParser.Tests.ps1 | 199 +++++ test/assets/attrib.01.txt | 12 + test/assets/columns.01.txt | 11 + test/assets/df.01.txt | 11 + test/assets/docker.01.txt | 9 + test/assets/docker.02.txt | 26 + test/assets/docker.03.txt | 26 + test/assets/docker.04.txt | 2 + test/assets/getmac.01.txt | 8 + test/assets/kmutil.01.txt | 31 + test/assets/ls.01.txt | 6 + test/assets/ls.02.txt | 6 + test/assets/ls.03.txt | 6 + test/assets/ps.01.txt | 7 + test/assets/ps.02.txt | 89 ++ test/assets/ps.03.txt | 7 + test/assets/ps.04.txt | 786 ++++++++++++++++++ test/assets/tasklist.01.txt | 48 ++ test/assets/tasklist.02.txt | 41 + test/assets/who.01.txt | 6 + test/assets/who.02.txt | 4 + 27 files changed, 1886 insertions(+), 45 deletions(-) create mode 100644 src/code/TextTableParser.cs create mode 100644 test/TextTableParser.Tests.ps1 create mode 100644 test/assets/attrib.01.txt create mode 100644 test/assets/columns.01.txt create mode 100644 test/assets/df.01.txt create mode 100644 test/assets/docker.01.txt create mode 100644 test/assets/docker.02.txt create mode 100644 test/assets/docker.03.txt create mode 100644 test/assets/docker.04.txt create mode 100644 test/assets/getmac.01.txt create mode 100644 test/assets/kmutil.01.txt create mode 100644 test/assets/ls.01.txt create mode 100644 test/assets/ls.02.txt create mode 100644 test/assets/ls.03.txt create mode 100644 test/assets/ps.01.txt create mode 100644 test/assets/ps.02.txt create mode 100644 test/assets/ps.03.txt create mode 100644 test/assets/ps.04.txt create mode 100644 test/assets/tasklist.01.txt create mode 100644 test/assets/tasklist.02.txt create mode 100644 test/assets/who.01.txt create mode 100644 test/assets/who.02.txt diff --git a/.gitignore b/.gitignore index e982541..e97d30b 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,6 @@ out/ *.nupkg project.lock.json .DS_Store - +Microsoft.PowerShell.TextUtility.xml # VSCode directories that are not at the repository root /**/.vscode/ diff --git a/build.ps1 b/build.ps1 index d6c3a6f..f37ba3d 100644 --- a/build.ps1 +++ b/build.ps1 @@ -19,6 +19,7 @@ param ( [switch] $signed, + [Parameter(ParameterSetName="package")] [Parameter(ParameterSetName="test")] [switch] $test, @@ -43,6 +44,7 @@ $moduleFileManifest = @( $moduleName = "Microsoft.PowerShell.TextUtility" $repoRoot = git rev-parse --show-toplevel +$testRoot = "${repoRoot}/test" # function Get-ModuleInfo { @@ -90,6 +92,25 @@ function Export-Module } } +function Test-Module { + try { + $PSVersionTable | Out-String -Stream | Write-Verbose -Verbose + $pesterInstallations = Get-Module -ListAvailable -Name Pester + if ($pesterInstallations.Version -notcontains "4.10.1") { + Install-Module -Name Pester -RequiredVersion 4.10.1 -Force -Scope CurrentUser + } + $importTarget = "Import-Module ${PSScriptRoot}/out/${ModuleName}" + $importPester = "Import-Module Pester -Max 4.10.1" + $invokePester = "Invoke-Pester -OutputFormat NUnitXml -EnableExit -OutputFile ../Microsoft.PowerShell.TextUtility.xml" + $command = "${importTarget}; ${importPester}; ${invokePester}" + Push-Location $testRoot + pwsh -noprofile -command $command + } + finally { + Pop-Location + } +} + try { Push-Location "$PSScriptRoot/src/code" $script:moduleInfo = Get-ModuleInfo @@ -112,6 +133,9 @@ try { } if ($Test) { + Test-Module + + <# $script = [ScriptBlock]::Create("try { Import-Module '${repoRoot}/out/${moduleName}/' Import-Module -Name Pester -Max 4.99 @@ -122,6 +146,8 @@ try { Pop-Location }") pwsh -c $script + #> + return } if ($Package) { diff --git a/src/Microsoft.PowerShell.TextUtility.psd1 b/src/Microsoft.PowerShell.TextUtility.psd1 index 5e4446b..ddb5209 100644 --- a/src/Microsoft.PowerShell.TextUtility.psd1 +++ b/src/Microsoft.PowerShell.TextUtility.psd1 @@ -3,7 +3,7 @@ @{ RootModule = '.\Microsoft.PowerShell.TextUtility.dll' - ModuleVersion = '0.1.0' + ModuleVersion = '0.5.0' CompatiblePSEditions = @('Desktop', 'Core') GUID = '5cb64356-cd04-4a18-90a4-fa4072126155' Author = 'Microsoft Corporation' @@ -13,14 +13,13 @@ PowerShellVersion = '5.1' FormatsToProcess = @('Microsoft.PowerShell.TextUtility.format.ps1xml') CmdletsToExport = @( - 'Compare-Text','ConvertFrom-Base64','ConvertTo-Base64' + 'Compare-Text','ConvertFrom-Base64','ConvertTo-Base64',"ConvertFrom-TextTable" ) PrivateData = @{ PSData = @{ LicenseUri = 'https://github.com/PowerShell/TextUtility/blob/main/LICENSE' ProjectUri = 'https://github.com/PowerShell/TextUtility' - ReleaseNotes = 'Initial release' - Prerelease = 'Preview1' + ReleaseNotes = 'Second pre-release' } } diff --git a/src/code/Microsoft.PowerShell.TextUtility.csproj b/src/code/Microsoft.PowerShell.TextUtility.csproj index 906d43b..ad59249 100644 --- a/src/code/Microsoft.PowerShell.TextUtility.csproj +++ b/src/code/Microsoft.PowerShell.TextUtility.csproj @@ -17,6 +17,9 @@ all + + all + diff --git a/src/code/TextTableParser.cs b/src/code/TextTableParser.cs new file mode 100644 index 0000000..ff3c31f --- /dev/null +++ b/src/code/TextTableParser.cs @@ -0,0 +1,453 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Management.Automation; +using System.Text.Json; + +namespace TextTableParser +{ + public class ColumnInfo { + public int Start; + public int Length; + public int SpaceLength; + } + + public class HeaderField { + public string Name; + public int Start; + public int Length; + } + + public class ObjectPropertyInfo { + public HeaderField[] HeaderFields; + ObjectPropertyInfo(string line, ColumnInfo[] cInfos) + { + HeaderFields = new HeaderField[cInfos.Length]; + for(int i = 0; i < cInfos.Length; i++) + { + HeaderFields[i] = new HeaderField(){ + Name = line.Substring(cInfos[i].Start, cInfos[i].Length).Trim(), + Start = cInfos[i].Start, + Length = cInfos[i].Length + }; + + } + } + } + + [Cmdlet("ConvertFrom","TextTable")] + public class ConvertTextTableCommand : PSCmdlet + { + [Parameter()] + public int MaximumWidth { get; set; } = 200; + + [Parameter()] + public int AnalyzeRowCount { get; set; } = 0; // 0 is all + + [Parameter(ValueFromPipeline=true,Mandatory=true,Position=0)] + [AllowEmptyString()] + public string[] Line { get; set; } + + [Parameter()] + public int Skip { get; set; } = 0; + + [Parameter()] + public SwitchParameter NoHeader { get; set; } + + [Parameter()] + public SwitchParameter AsJson { get; set; } + + [Parameter()] + public int[] ColumnOffset { get; set; } + + [Parameter()] + public SwitchParameter ConvertPropertyValue { get; set; } + + [Parameter()] + public int HeaderLine { get; set; } = 0; // Assume the first line is the header + + [Parameter()] + public string[] TypeName { get; set; } + + private ListLines = new List(); + + private int SkippedLines = 0; + protected override void BeginProcessing() + { + if (NoHeader) + { + HeaderLine = -1; + } + + } + + private int[] SpaceArray; + private string spaceRepresentation; + private bool Analyzed = false; + + protected override void ProcessRecord() + { + if (Line is null) + { + return; + } + + foreach(string _line in Line) + { + + // don't add empty lines + if(string.IsNullOrEmpty(_line)) + { + continue; + } + + // add the line to the list if we've skipped enough lines + if (SkippedLines++ >= Skip) + { + Lines.Add(_line); + } + + if (AnalyzeRowCount == 0) + { + continue; + } + + // We've done the analysis, so just emit the object or json. + if(Analyzed) + { + Emit(_line); + continue; + } + + if (Lines.Count == 0) { continue; } + // We've collected enough lines to analyze + // analyze what we have and then emit them, set the analyzed flag so we will just emit from now on. + if (! Analyzed && Lines.Count > AnalyzeRowCount) + { + AnalyzeLines(Lines); + Analyzed = true; + foreach(string l in Lines) + { + Emit(l); + } + Lines.Clear(); // unneeded + // Calculate the column widths + } + } + } + + protected override void EndProcessing() + { + if (Lines.Count == 0) { return; } + if (!Analyzed) + { + AnalyzeLines(Lines); + foreach(string _line in Lines) + { + Emit(_line); + } + } + } + + private void Emit(string line) + { + if (ColumnInfoList != null && columnHeaders != null) + { + if (AsJson) + { + var jsonOptions = new JsonSerializerOptions(); + jsonOptions.MaxDepth = 1; + WriteObject(GetJson(ColumnInfoList, line, columnHeaders)); + } + else + { + WriteObject(GetPsObject(ColumnInfoList, line, columnHeaders)); + } + } + else + { + WriteError(new ErrorRecord(new Exception("No column info"), "NoColumnInfo", ErrorCategory.InvalidOperation, null)); + } + } + + private List ColumnInfoList { get; set; } + private string[] columnHeaders { get; set; } + + private void AnalyzeLines(List lines) + { + if (lines.Count == 0) + { + return; + } + SpaceArray = AnalyzeColumns(Lines); + spaceRepresentation = GetSpaceRepresentation(Lines.Count, SpaceArray); + if (ColumnOffset != null) + { + ColumnInfoList = GetColumnList(ColumnOffset); + } + else + { + ColumnInfoList = GetColumnList(Lines.Count, SpaceArray); + } + + if (NoHeader) + { + columnHeaders = new string[ColumnInfoList.Count]; + for(int i = 0; i < ColumnInfoList.Count; i++) + { + columnHeaders[i] = string.Format("Property_{0:00}", i+1); + } + } + else + { + columnHeaders = GetHeaderColumns(ColumnInfoList, Lines[HeaderLine]); + Lines.RemoveAt(HeaderLine); + } + } + + private string GetSpaceRepresentation(int count, int[] spaceArray) + { + char[] spaceChars = new char[spaceArray.Length]; + for(int i = 0; i < spaceArray.Length; i++) + { + if (spaceArray[i] == count) + { + spaceChars[i] = 'S'; + } + else + { + spaceChars[i] = ' '; + } + } + return new string(spaceChars); + } + + public PSObject GetPsObject(List cInfos, string line, string[] columnHeaders) + { + PSObject o = new PSObject(); + if (TypeName != null) + { + foreach (string t in TypeName) + { + o.TypeNames.Insert(0, t); + } + } + object[]data = GetObjectColumnData(cInfos, line); + Debug.Assert(data.Length == columnHeaders.Length); + for(int i = 0; i < cInfos.Count; i++) + { + o.Properties.Add(new PSNoteProperty(columnHeaders[i], data[i])); + } + return o; + } + + public string GetJson(List cInfos, string line, string[] columnHeaders) + { + string[]data = GetStringColumnData(cInfos, line); + Debug.Assert(data.Length == columnHeaders.Length); + string[]dataWithHeader = new string[data.Length]; + for(int j = 0; j < data.Length; j++) + { + if (data[j] is string) + { + dataWithHeader[j] = string.Format("\"{0}\": \"{1}\"", columnHeaders[j], JsonEncodedText.Encode(data[j])); + } + else + { + dataWithHeader[j] = string.Format("\"{0}\": \"{1}\"", columnHeaders[j], (JsonEncodedText.Encode((string)data[j]))); + } + } + return string.Format("{{ {0} }}", string.Join(", ", dataWithHeader)); + } + + private object[] GetObjectColumnData(List cInfos, string line) + { + + object[] data = new object[cInfos.Count]; + for(int i = 0; i < cInfos.Count; i++) + { + string value; + if (cInfos[i].Length == -1) // end of line + { + value = line.Substring(cInfos[i].Start).Trim(); + } + else + { + value = line.Substring(cInfos[i].Start, cInfos[i].Length).Trim(); + } + + // If ConvertPropertyValue is specified, try to convert to int, int64, decimal, datetime, or timespan. + if (! ConvertPropertyValue) + { + data[i] = value; + } + else if (LanguagePrimitives.TryConvertTo(value, out int intValue)) + { + data[i] = intValue; + } + else if (LanguagePrimitives.TryConvertTo(value, out Int64 int64Value)) + { + data[i] = int64Value; + } + else if (LanguagePrimitives.TryConvertTo(value, out Decimal decimalValue)) + { + data[i] = decimalValue; + } + else if (LanguagePrimitives.TryConvertTo(value, out DateTime dateTimeValue)) + { + data[i] = dateTimeValue; + } + else if (LanguagePrimitives.TryConvertTo(value, out TimeSpan timeSpanValue)) + { + data[i] = timeSpanValue; + } + else if (LanguagePrimitives.TryConvertTo(string.Format("0:{0}", value), out TimeSpan exTimeSpanValue)) + { + data[i] = exTimeSpanValue; + } + else + { + data[i] = value; + } + } + return data; + } + + // This will return the data in the columns as an array of objects. + // We will try to convert the data to a type that makes sense. + private string[] GetStringColumnData(List cInfos, string line) + { + string[] data = new string[cInfos.Count]; + for(int i = 0; i < cInfos.Count; i++) + { + string value; + if (cInfos[i].Length == -1) // end of line + { + value = line.Substring(cInfos[i].Start).Trim(); + } + else + { + value = line.Substring(cInfos[i].Start, cInfos[i].Length).Trim(); + } + data[i] = value; + + } + return data; + } + + private string[] GetHeaderColumns(List cInfos, string line) + { + string[] columns = new string[cInfos.Count]; + for(int i = 0; i < cInfos.Count; i++) + { + if (cInfos[i].Length == -1) // end of line + { + columns[i] = line.Substring(cInfos[i].Start).Trim().Replace(" ", "_"); + } + else + { + columns[i] = line.Substring(cInfos[i].Start, cInfos[i].Length).Trim().Replace(" ", "_"); + } + } + return columns; + } + + private int GetMaxLength(Listlines) + { + int maximumLength = 0; + foreach(string line in lines) + { + if (line.Length > maximumLength) + { + maximumLength = line.Length; + } + } + return maximumLength; + } + + // Analyze for white space. If we find consistent white space, + // then we can use that to determine the columns. + // If the value in the array element is the same as the number of lines, + // we have a column. + + private int[] AnalyzeColumns(Listlines) + { + int maximumLength = GetMaxLength(lines); + int[] SpaceArray = new int[maximumLength]; + for(int i = 0; i < maximumLength; i++) + { + SpaceArray[i] = 0; + } + + foreach(string line in lines) + { + for(int i = 0; i < line.Length; i++) + { + if(char.IsWhiteSpace(line[i])) + { + SpaceArray[i] += 1; + } + } + } + return SpaceArray; + } + + private List GetColumnList(int[]StartColumns) + { + List ColumnInfoList = new List(); + for(int i = 0; i < StartColumns.Length; i++) + { + int length; + try + { + length = StartColumns[i+1] - StartColumns[i]; + } + catch + { + length = -1; + } + ColumnInfoList.Add(new ColumnInfo() { Start = StartColumns[i], Length = length, SpaceLength = 0 }); + + } + return ColumnInfoList; + } + + // Get the column list from the space array. + private List GetColumnList(int count, int[]SpaceArray) + { + List ColumnInfoList = new List(); + for(int i = 0; i < SpaceArray.Length; i++) { + ColumnInfoList.Add( + new ColumnInfo() { Start = i, Length = 0, SpaceLength = 0 } + ); + // Chew up the spaces + while (i < SpaceArray.Length && SpaceArray[i] == count) + { + ColumnInfoList[ColumnInfoList.Count - 1].SpaceLength++; + ColumnInfoList[ColumnInfoList.Count - 1].Length++; + i++; + } + + // chew up the non spaces or end of line + while(i < SpaceArray.Length && SpaceArray[i] != count) + { + ColumnInfoList[ColumnInfoList.Count - 1].Length++; + i++; + } + + int totalLength = ColumnInfoList[ColumnInfoList.Count-1].Length + ColumnInfoList[ColumnInfoList.Count-1].Start; + if (totalLength >= SpaceArray.Length) + { + ColumnInfoList[ColumnInfoList.Count - 1].Length = -1; + } + + i--; + } + + return ColumnInfoList; + } + } +} diff --git a/test/CompareText.tests.ps1 b/test/CompareText.tests.ps1 index 21856f2..bcc8201 100644 --- a/test/CompareText.tests.ps1 +++ b/test/CompareText.tests.ps1 @@ -1,57 +1,76 @@ ## Copyright (c) Microsoft Corporation. ## Licensed under the MIT License. -Describe 'Compare-Test tests' { +Describe 'Compare-Text tests' { BeforeAll { - $leftText = @" -This is some -example text. -"@ - $rightText = @" - This is other -example text used! -"@ - - $expectedInline = @" - - This is someother -example text. used! - - -"@ - - $expectedSideBySide = @" - -1 | This is some  |  This is other… -2 | example text. | example text… - - - -"@ + $currentOutputRendering = $PSStyle.OutputRendering + $PSStyle.OutputRendering = 'Ansi' + $leftText = @("This is some", "example text.") -join [Environment]::NewLine + $rightText = @(" This is other", "example text used!") -join [Environment]::NewLine + $expectedInline = @( + "" + "``e[0;1;32m ``e[0mThis is ``e[1;9;31msome``e[0m``e[0;1;32mother``e[0m" + "example text``e[1;9;31m.``e[0m``e[0;1;32m used!``e[0m" + "" + ) + $expectedSideBySide = @( + "" + "``e[0m1 | ``e[0mThis is ``e[1;9;31msome``e[0m``e[0m ``e[0m | ``e[0;1;32m ``e[0mThis is ``e[0;1;32mother``e…" + "``e[0m2 | ``e[0mexample text``e[1;9;31m.``e[0m``e[0m | ``e[0mexample text``e[0;1;32m…" + "``e[0m" + "" + ) + # this reset text was added in 7.3.0, we need to remove it from the output so the tests can pass on different ps versions. + $inlineResetText = "``e[0;1;32m``e[0m``e[1;9;31m``e[0m``e[0;1;32m``e[0m" + $sideBySideResetText = "``e[0m``e[0m``e[1;9;31m``e[0m``e[0m``e[0m``e[0;1;32m``e[0m``e[0;1;32m" + } + AfterAll { + $PSStyle.OutputRendering = $currentOutputRendering } + # These tests convert the emitted escape sequences to their literal representation + # to ease debugging. Also, we use Out-String -Stream to get the output as a collection which Pester 4.10.1 can handle. It 'Compare with no specified view uses inline' { - Set-ItResult -pending -because "comparison tests are not yet running" - $out = Compare-Text -LeftText $leftText -RightText $rightText | Out-String - $out | Should -BeExactly $expectedInline + $out = Compare-Text -LeftText $leftText -RightText $rightText | Out-String -Stream | Foreach-Object {"$_".Replace("`e","``e").Replace($inlineResetText, "")} + $out | Should -Be $expectedInline } It 'Compare with no specified view uses inline and positional parameters' { - Set-ItResult -pending -because "comparison tests are not yet running" - $out = Compare-Text $leftText $rightText | Out-String - $out | Should -BeExactly $expectedInline + $out = Compare-Text $leftText $rightText | Out-String -Stream | Foreach-Object {"$_".Replace("`e","``e").Replace($inlineResetText, "")} + $out | Should -Be $expectedInline } It 'Compare with inline works' { - Set-ItResult -pending -because "comparison tests are not yet running" - $out = Compare-Text $leftText $rightText -View Inline | Out-String - $out | Should -BeExactly $expectedInline + $out = Compare-Text $leftText $rightText -View Inline | Out-String -Stream | Foreach-Object {"$_".Replace("`e","``e").Replace($inlineResetText, "")} + $out | Should -Be $expectedInline + } + + It 'Compare with sidebyside works' { + Set-ItResult -Pending -Because "https://github.com/PowerShell/TextUtility/issues/30" + $out = Compare-Text $leftText $rightText -View SideBySide | Out-String -Stream | Foreach-Object {"$_".Replace("`e","``e").Replace($sideBySideResetText, "")} + $out | Should -Be $expectedSideBySide } - It 'Compare with sideybyside works' { - Set-ItResult -pending -because "comparison tests are not yet running" - $out = Compare-Text $leftText $rightText -View SideBySide | Out-String - $out | Should -BeExactly $expectedSideBySide + + Context "PlainText comparison" { + BeforeAll { + $currentRendering = $PSStyle.OutputRendering + $PSStyle.OutputRendering = 'PlainText' + } + + AfterAll { + $PSStyle.OutputRendering = $currentRendering + } + + It "Default view should have no escape characters" { + (Compare-Text $leftText $rightText | Out-String -Stream) | Should -Not -Match "`e" + } + + It "SideBySide view should have no escape characters" { + Set-ItResult -Pending -Because "https://github.com/PowerShell/TextUtility/issues/30" + (Compare-Text $leftText $rightText -View SideBySide | Out-String -Stream) | Should -Not -Match "`e" + } + } -} +} \ No newline at end of file diff --git a/test/TextTableParser.Tests.ps1 b/test/TextTableParser.Tests.ps1 new file mode 100644 index 0000000..fc2643b --- /dev/null +++ b/test/TextTableParser.Tests.ps1 @@ -0,0 +1,199 @@ +Describe "Test text table parser" { + BeforeAll { + $cmdletName = "ConvertFrom-TextTable" + $testCases = @{ + FileName = "attrib.01.txt" + convertArgs = @{ NoHeader = $true } + Rows = 12 + Results = @{Row = 0; Property_01 = "A";Property_02 = "C:\windows\system32\mmgaserver.exe"}, + @{Row = -1; Property_01 = "A";Property_02 = "C:\windows\system32\msdtc.exe"} + }, + @{ + FileName = "df.01.txt" + convertArgs = @{} + Rows = 10 + Results = @{ Row = 0; "Filesystem" = "/dev/disk4s1s1"; "512-blocks" = "3907805752"; "Used" = "17463888"; "Available" = "1387159800"; "Capacity" = "2%"; "iused" = "349475"; "ifree" = "4291443272"; "%iused" = "0%"; "Mounted_on" = "/" }, + @{ Row = 1; "Filesystem" = "devfs"; "512-blocks" = "427"; "Used" = "427"; "Available" = "0"; "Capacity" = "100%"; "iused" = "739"; "ifree" = "0"; "%iused" = "100%"; "Mounted_on" = "/dev" } + }, + @{ + FileName = "docker.01.txt" + convertArgs = @{} + Rows = 8 + Results = @{ ROW = 0; "REPOSITORY" = "docker101tutorial"; "TAG" = "latest"; "IMAGE_ID" = "234e26cd95c2"; "CREATED" = "5 weeks ago"; "SIZE" = "28.9MB" }, + @{ Row = 3; "REPOSITORY" = "alpine/git"; "TAG" = "latest"; "IMAGE_ID" = "692618a0d74d"; "CREATED" = "6 weeks ago"; "SIZE" = "43.4MB" } + }, + @{ + FileName = "docker.02.txt" + convertArgs = @{} + Rows = 25 + Results = @{ ROW = 0; "NAME" = "centos/powershell"; "DESCRIPTION" = "PowerShell is a cross-platform (Windows, Lin`u{2026}"; "STARS" = "8"; "OFFICIAL" = ""; "AUTOMATED" = "[OK]" }, + @{ ROW = 20; "NAME" = "powershellduzero/api"; "DESCRIPTION" = ""; "STARS" = "0"; "OFFICIAL" = ""; "AUTOMATED" = "" } + }, + @{ + FileName = "docker.03.txt" + convertArgs = @{} + Rows = 25 + Results = @{ ROW = 22; "NAME" = "zoilus/powershell"; "DESCRIPTION" = ""; "STARS" = "0"; "OFFICIAL" = ""; "AUTOMATED" = "" }, + @{ ROW = 23; "NAME" = "ephesoft/powershell.git"; "DESCRIPTION" = "Powershell image with Git pre-installed"; "STARS" = "0"; "OFFICIAL" = ""; "AUTOMATED" = "" } + }, + @{ + FileName = "docker.04.txt" + convertArgs = @{} + Rows = 1 + Results = @(@{ ROW = 0; "DRIVER" = "local"; "VOLUME_NAME" = "6bf5c897a2cdcf0bfe5da45a795fa7fe94032f79b98d2f63563578ed40d0f0c6" }) + }, + @{ + FileName = "getmac.01.txt" + convertArgs = @{} + Rows = 6 + Results = @{ ROW = 3; "Physical_Address" = "0C-C4-7A-28-C7-13"; "Transport_Name" = "\Device\Tcpip_{8234FC65-751E-4B56-AB8A-0758A4C18889}" }, + @{ ROW = 4; "Physical_Address" = "0C-C4-7A-28-C7-12"; "Transport_Name" = "N/A" } + }, + @{ + FileName = "kmutil.01.txt" + convertArgs = @{} + Rows = 30 + Results = @{ ROW = 0; "Index" = "1"; "Refs" = "161"; "Address" = "0"; "Size" = "0"; "Wired" = "0"; "Name_(Version)_UUID_" = "com.apple.kpi.bsd (22.3.0) 10E5D254-4A37-3A2A-B560-E6956A093ADE `u{003C}`u{003E}" }, + @{ ROW = 1; "Index" = "2"; "Refs" = "12"; "Address" = "0"; "Size" = "0"; "Wired" = "0"; "Name_(Version)_UUID_" = "com.apple.kpi.dsep (22.3.0) 10E5D254-4A37-3A2A-B560-E6956A093ADE `u{003C}`u{003E}" } + }, + @{ + FileName = "ls.01.txt" + convertArgs = @{skip = 1; NoHeader = $true } + Rows = 5 + Results = @{ ROW = 0; "Property_01" = "-rw-r--r--"; "Property_02" = "1"; "Property_03" = "james"; "Property_04" = "staff"; "Property_05" = "2687"; "Property_06" = "Oct"; "Property_07" = "12"; "Property_08" = "16:58"; "Property_09" = "NativeTableParser.deps.json" }, + @{ ROW = 3; "Property_01" = "-rwxr--r--"; "Property_02" = "1"; "Property_03" = "james"; "Property_04" = "staff"; "Property_05" = "354304"; "Property_06" = "Mar"; "Property_07" = "7"; "Property_08" = "2019"; "Property_09" = "System.Management.Automation.dll" } + }, + @{ + FileName = "ls.02.txt" + convertArgs = @{ skip = 1; NoHeader = $true } + Rows = 5 + Results = @(@{ ROW = 4; "Property_01" = "-rwxr--r--"; "Property_02" = "1"; "Property_03" = "james"; "Property_04" = "457864"; "Property_05" = "Aug"; "Property_06" = "19"; "Property_07" = "12:49"; "Property_08" = "System.Text.Json.dll" }) + }, + @{ + FileName = "ls.03.txt" + convertArgs = @{ skip = 1; NoHeader = $true } + Rows = 5 + Results = @{ ROW = 1; "Property_01" = "-rw-r--r--"; "Property_02" = "1"; "Property_03" = "12288"; "Property_04" = "Oct"; "Property_05" = "12"; "Property_06" = "16:58"; "Property_07" = "NativeTableParser.dll" }, + @{ ROW = 2; "Property_01" = "-rw-r--r--"; "Property_02" = "1"; "Property_03" = "14512"; "Property_04" = "Oct"; "Property_05" = "12"; "Property_06" = "16:58"; "Property_07" = "NativeTableParser.pdb" } + }, + @{ + FileName = "ps.01.txt" + convertArgs = @{ } + Rows = 6 + Results = @{ ROW = 0; "PID" = "2596"; "TTY" = "ttys000"; "TIME" = "1:59.45"; "CMD" = "/usr/local/bin/pwsh -l" }, + @{ ROW = 1; "PID" = "2601"; "TTY" = "ttys001"; "TIME" = "0:44.13"; "CMD" = "/usr/local/bin/pwsh -l" }, + @{ ROW = 2; "PID" = "2661"; "TTY" = "ttys002"; "TIME" = "0:23.53"; "CMD" = "/usr/local/bin/pwsh" } + }, + @{ + FileName = "ps.02.txt" + convertArgs = @{ } + Rows = 88 + Results = @{ ROW = 82; "UID" = "0"; "PID" = "69835"; "PPID" = "2596"; "C" = "0"; "STIME" = "8:25AM"; "TTY" = "ttys000"; "TIME" = "0:00.01"; "CMD" = "/bin/ps -ef" }, + @{ ROW = 85; "UID" = "501"; "PID" = "2669"; "PPID" = "2658"; "C" = "0"; "STIME" = "9:45AM"; "TTY" = "ttys003"; "TIME" = "0:23.04"; "CMD" = "/usr/local/bin/pwsh" }, + @{ ROW = 87; "UID" = "501"; "PID" = "2676"; "PPID" = "2658"; "C" = "0"; "STIME" = "9:45AM"; "TTY" = "ttys005"; "TIME" = "0:23.16"; "CMD" = "/usr/local/bin/pwsh" } + }, + @{ + FileName = "ps.03.txt" + convertArgs = @{ } + Rows = 6 + Results = @{ ROW = 0; "UID" = "501"; "PID" = "2596"; "PPID" = "2587"; "F" = "4006"; "CPU" = "0"; "PRI" = "33"; "NI" = "0"; "SZ" = "39662748"; "RSS" = "167544"; "WCHAN" = "-"; "S" = "S`u{002B}"; "ADDR" = "0"; "TTY" = "ttys000"; "TIME" = "2:01.35"; "CMD" = "/usr/local/bin/pwsh -l" }, + @{ ROW = 5; "UID" = "501"; "PID" = "2676"; "PPID" = "2658"; "F" = "4006"; "CPU" = "0"; "PRI" = "33"; "NI" = "0"; "SZ" = "39658344"; "RSS" = "136596"; "WCHAN" = "-"; "S" = "Ss`u{002B}"; "ADDR" = "0"; "TTY" = "ttys005"; "TIME" = "0:23.17"; "CMD" = "/usr/local/bin/pwsh" } + + }, + @{ + FileName = "ps.04.txt" + convertArgs = @{ } + Rows = 785 + Results = @{ ROW = 782; "PID" = "2676"; "TTY" = "ttys005"; "TIME" = "0:27.57"; "CMD" = "pwsh" }, + @{ ROW = 783; "PID" = "94197"; "TTY" = "ttys006"; "TIME" = "1:07.57"; "CMD" = "pwsh" }, + @{ ROW = 784; "PID" = "94200"; "TTY" = "ttys007"; "TIME" = "0:05.13"; "CMD" = "pwsh" } + }, + @{ + FileName = "tasklist.01.txt" + convertArgs = @{} + Rows = 46 + Results = @{ ROW = 0; "Image_Name" = "========================="; "PID" = "========"; "Session_Name" = "================"; "Session#" = "==========="; "Mem_Usage" = "============" }, + @{ ROW = 1; "Image_Name" = "System Idle Process"; "PID" = "0"; "Session_Name" = "Services"; "Session#" = "0"; "Mem_Usage" = "8 K" }, + @{ ROW = 2; "Image_Name" = "System"; "PID" = "4"; "Session_Name" = "Services"; "Session#" = "0"; "Mem_Usage" = "8,240 K" } + }, + @{ + FileName = "tasklist.02.txt" + convertArgs = @{} + Rows = 39 + Results = @{ ROW = 14; "Image_Name" = "svchost.exe"; "PID" = "1364"; "Session_Name" = "Services"; "Session#" = "0"; "Mem_Usage" = "24,896 K" }, + @{ ROW = 15; "Image_Name" = "svchost.exe"; "PID" = "1412"; "Session_Name" = "Services"; "Session#" = "0"; "Mem_Usage" = "18,576 K" } + }, + @{ + FileName = "who.01.txt" + convertArgs = @{ NoHeader = $true } + Rows = 6 + Results = @{ ROW = 0; "Property_01" = "reboot"; "Property_02" = "~"; "Property_03" = "Sep"; "Property_04" = "14"; "Property_05" = "10:10"; "Property_06" = "00:04"; "Property_07" = "1" }, + @{ ROW = 4; "Property_01" = "james"; "Property_02" = "ttys002"; "Property_03" = "Oct"; "Property_04" = "5"; "Property_05" = "16:36"; "Property_06" = "."; "Property_07" = "90609`tterm=0 exit=0" }, + @{ ROW = 5; "Property_01" = "james"; "Property_02" = "ttys006"; "Property_03" = "Oct"; "Property_04" = "11"; "Property_05" = "15:41"; "Property_06" = "."; "Property_07" = "25351`tterm=0 exit=0" } + } + + } + + Context "Test JSON output" { + + It "Should create proper json from '' " -testCases $testCases { + param ($FileName, $convertArgs, $rows, $Results) + $Path = Join-Path $PSScriptRoot assets $FileName + # do not alter convertArgs directly as it is a reference rather than a copy + $localArgs = $convertArgs.Clone() + $localArgs['AsJson'] = $true + { Get-Content $Path | ConvertFrom-TextTable @localArgs | ConvertFrom-Json -ErrorAction Stop } | Should -Not -Throw + $result = Get-Content $Path | ConvertFrom-TextTable @localArgs | ConvertFrom-Json -ErrorAction Ignore + $result | Should -Not -BeNullOrEmpty + $result.Count | Should -Be $Rows + foreach ( $r in $results ) { + $rObject = $result[$r.Row] + foreach ( $k in $r.Keys.Where({$_ -ne "Row"}) ) { + $rObject."$k" | Should -Be $r."$k" + } + } + } + } + + Context "Test PSObject output" { + It "Should create proper psobject from '' " -testCases $testCases { + param ($FileName, $convertArgs, $rows, $Results ) + $Path = Join-Path $PSScriptRoot assets $FileName + $result = Get-Content $Path | ConvertFrom-TextTable @convertArgs + $result | Should -BeOfType System.Management.Automation.PSObject + $result.Count | Should -Be $Rows + foreach ( $r in $results ) { + $rObject = $result[$r.Row] + foreach ( $k in $r.Keys.Where({$_ -ne "Row"}) ) { + $rObject."$k" | Should -Be $r."$k" + } + } + } + } + + Context "Column offset use" { + BeforeAll { + $expectedResult = @( + @{ Name = "Property_01"; Value = "S1234" } + @{ Name = "Property_02"; Value = "56789012" } + @{ Name = "Property_03"; Value = "3456789012" } + @{ Name = "Property_04"; Value = "34567890123456789" } + @{ Name = "Property_05"; Value = "012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" } + ) + $testFile = Join-Path $PSScriptRoot assets "columns.01.txt" + $result = Get-Content $testFile | ConvertFrom-TextTable -ColumnOffset 0,5,13,23,40 -noheader + $line = 0 + $testCases = $result.ForEach({@{Result = $_; Line = $line++}}) + } + + It "Specifying column offset breaks string properly for Line: ''" -TestCases $testCases { + param ( $Result, $Line ) + foreach ($expected in $expectedResult) { + $Result.$($expected.Name) | Should -Be $expected.Value + } + } + + } + + +} diff --git a/test/assets/attrib.01.txt b/test/assets/attrib.01.txt new file mode 100644 index 0000000..36836ec --- /dev/null +++ b/test/assets/attrib.01.txt @@ -0,0 +1,12 @@ +A C:\windows\system32\mmgaserver.exe +A C:\windows\system32\mobsync.exe +A C:\windows\system32\mountvol.exe +A C:\windows\system32\mpnotify.exe + C:\windows\system32\MpSigStub.exe +A C:\windows\system32\MRINFO.EXE +A C:\windows\system32\MRT-KB890830.exe +A C:\windows\system32\MRT.exe +A C:\windows\system32\MSchedExe.exe +A C:\windows\system32\msconfig.exe +A C:\windows\system32\msdt.exe +A C:\windows\system32\msdtc.exe diff --git a/test/assets/columns.01.txt b/test/assets/columns.01.txt new file mode 100644 index 0000000..cc82457 --- /dev/null +++ b/test/assets/columns.01.txt @@ -0,0 +1,11 @@ +S123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +S123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +S123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +S123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +S123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +S123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +S123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +S123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +S123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +S123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +S123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 diff --git a/test/assets/df.01.txt b/test/assets/df.01.txt new file mode 100644 index 0000000..8aa66a5 --- /dev/null +++ b/test/assets/df.01.txt @@ -0,0 +1,11 @@ +Filesystem 512-blocks Used Available Capacity iused ifree %iused Mounted on +/dev/disk4s1s1 3907805752 17463888 1387159800 2% 349475 4291443272 0% / +devfs 427 427 0 100% 739 0 100% /dev +/dev/disk4s3 3907805752 3606904 1387159800 1% 3084 6935799000 0% /System/Volumes/Preboot +/dev/disk4s5 3907805752 40 1387159800 1% 0 6935799000 0% /System/Volumes/VM +/dev/disk4s6 3907805752 16864 1387159800 1% 20 6935799000 0% /System/Volumes/Update +/dev/disk4s2 3907805752 2496758616 1387159800 65% 5089355 6935799000 0% /System/Volumes/Data +map auto_home 0 0 0 100% 0 0 100% /System/Volumes/Data/home +/dev/disk5s1 7812714496 3045995928 4765770992 39% 2347862 23828854960 0% /Volumes/Sabrent +/dev/disk8s1 976735232 555696128 421039104 57% 2170688 1644684 57% /Volumes/Samsung500 +/dev/disk7s2 3906619488 3649692040 256341328 94% 3760967 1281706640 0% /Volumes/TOSHIBA EXT diff --git a/test/assets/docker.01.txt b/test/assets/docker.01.txt new file mode 100644 index 0000000..401d077 --- /dev/null +++ b/test/assets/docker.01.txt @@ -0,0 +1,9 @@ +REPOSITORY TAG IMAGE ID CREATED SIZE +docker101tutorial latest 234e26cd95c2 5 weeks ago 28.9MB +mcr.microsoft.com/powershell preview-7.3-mariner-2.0 4e9617ada198 5 weeks ago 235MB +mcr.microsoft.com/powershell latest 4bcdf53ee67b 5 weeks ago 339MB +alpine/git latest 692618a0d74d 6 weeks ago 43.4MB +mcr.microsoft.com/mssql/server 2022-latest 97a21961f76d 7 weeks ago 1.6GB +mcr.microsoft.com/powershell/test-deps ubi-8.4 02214dbfb621 2 months ago 640MB +alpine latest 9c6f07244728 2 months ago 5.54MB +mcr.microsoft.com/mssql/server 2019-latest e3afdc6d8e5c 2 months ago 1.47GB diff --git a/test/assets/docker.02.txt b/test/assets/docker.02.txt new file mode 100644 index 0000000..14cda11 --- /dev/null +++ b/test/assets/docker.02.txt @@ -0,0 +1,26 @@ +NAME DESCRIPTION STARS OFFICIAL AUTOMATED +centos/powershell PowerShell is a cross-platform (Windows, Lin… 8 [OK] +quickbreach/powershell-ntlm Read more https://blog.quickbreach.io/ps-rem… 3 [OK] +rahuldevdockerservice/powershellscriptrunner run PowerShell script in docker 3 +tylerl0706/powershell-code-server Coder.com's code-server, PowerShell, and the… 2 +pshorg/powershellcommunity PowerShell for every system! Community Imag… 2 +fxinnovation/powershell Alpine Linux based powershell image 1 +demisto/powershell 1 +scrthq/powershell Ubuntu 18.04 containers (pwsh & pwsh-preview… 1 +truecharts/powershelluniversal 0 +joeltimothyoh/powershell PowerShell on Docker with tools, based on m… 0 +mbiregistry/powershell 0 +franciscogamino/powershell72 0 +clowa/powershell-core Cross platform docker image of powershell co… 0 +devtestdemisto/powershell-ubuntu 0 +demisto/powershell-ubuntu 0 +demisto/powershell-core 0 +relaysh/powershell-step-run Relay step for running PowerShell script 0 +powershellduzero/github_repo Listing site for my GitHub Repositories 0 +devtestdemisto/powershell 0 +dispatchframework/powershell-base 0 +powershellduzero/api 0 +centeredge/powershell.git Linux image with Powershell and Git available 0 +zoilus/powershell 0 +ephesoft/powershell.git Powershell image with Git pre-installed 0 +fxinnovation/powershell-build 0 diff --git a/test/assets/docker.03.txt b/test/assets/docker.03.txt new file mode 100644 index 0000000..e1006b9 --- /dev/null +++ b/test/assets/docker.03.txt @@ -0,0 +1,26 @@ +NAME DESCRIPTION STARS OFFICIAL AUTOMATED +centos/powershell PowerShell is a cross-platform (Windows, Linux and OS X) automation and configuration tool/framework 8 [OK] +quickbreach/powershell-ntlm Read more https://blog.quickbreach.io/ps-remote-from-linux-to-windows/ 3 [OK] +rahuldevdockerservice/powershellscriptrunner run PowerShell script in docker 3 +tylerl0706/powershell-code-server Coder.com's code-server, PowerShell, and the PowerShell extension for vscode 2 +pshorg/powershellcommunity PowerShell for every system! Community Images! 2 +fxinnovation/powershell Alpine Linux based powershell image 1 +demisto/powershell 1 +scrthq/powershell Ubuntu 18.04 containers (pwsh & pwsh-preview) for PowerShell module building and testing. 1 +truecharts/powershelluniversal 0 +joeltimothyoh/powershell PowerShell on Docker with tools, based on mcr.microsoft.com/powershell. 🐳 0 +mbiregistry/powershell 0 +franciscogamino/powershell72 0 +clowa/powershell-core Cross platform docker image of powershell core 0 +devtestdemisto/powershell-ubuntu 0 +demisto/powershell-ubuntu 0 +demisto/powershell-core 0 +relaysh/powershell-step-run Relay step for running PowerShell script 0 +powershellduzero/github_repo Listing site for my GitHub Repositories 0 +devtestdemisto/powershell 0 +dispatchframework/powershell-base 0 +powershellduzero/api 0 +centeredge/powershell.git Linux image with Powershell and Git available 0 +zoilus/powershell 0 +ephesoft/powershell.git Powershell image with Git pre-installed 0 +fxinnovation/powershell-build 0 diff --git a/test/assets/docker.04.txt b/test/assets/docker.04.txt new file mode 100644 index 0000000..fa2cfa9 --- /dev/null +++ b/test/assets/docker.04.txt @@ -0,0 +1,2 @@ +DRIVER VOLUME NAME +local 6bf5c897a2cdcf0bfe5da45a795fa7fe94032f79b98d2f63563578ed40d0f0c6 diff --git a/test/assets/getmac.01.txt b/test/assets/getmac.01.txt new file mode 100644 index 0000000..da78caa --- /dev/null +++ b/test/assets/getmac.01.txt @@ -0,0 +1,8 @@ + +Physical Address Transport Name +=================== ========================================================== +0C-C4-7A-28-C7-12 \Device\Tcpip_{E18CCFE3-A60F-48CB-B223-3F38DED8A124} +00-25-90-10-83-F5 \Device\Tcpip_{C16BBA38-CFD1-4FE5-9143-064095F5268F} +0C-C4-7A-28-C7-13 \Device\Tcpip_{8234FC65-751E-4B56-AB8A-0758A4C18889} +0C-C4-7A-28-C7-12 N/A +0C-C4-7A-28-C7-13 Media disconnected diff --git a/test/assets/kmutil.01.txt b/test/assets/kmutil.01.txt new file mode 100644 index 0000000..2dc2813 --- /dev/null +++ b/test/assets/kmutil.01.txt @@ -0,0 +1,31 @@ +Index Refs Address Size Wired Name (Version) UUID + 1 161 0 0 0 com.apple.kpi.bsd (22.3.0) 10E5D254-4A37-3A2A-B560-E6956A093ADE <> + 2 12 0 0 0 com.apple.kpi.dsep (22.3.0) 10E5D254-4A37-3A2A-B560-E6956A093ADE <> + 3 206 0 0 0 com.apple.kpi.iokit (22.3.0) 10E5D254-4A37-3A2A-B560-E6956A093ADE <> + 4 0 0 0 0 com.apple.kpi.kasan (22.3.0) 10E5D254-4A37-3A2A-B560-E6956A093ADE <> + 5 0 0 0 0 com.apple.kpi.kcov (22.3.0) 10E5D254-4A37-3A2A-B560-E6956A093ADE <> + 6 212 0 0 0 com.apple.kpi.libkern (22.3.0) 10E5D254-4A37-3A2A-B560-E6956A093ADE <> + 7 190 0 0 0 com.apple.kpi.mach (22.3.0) 10E5D254-4A37-3A2A-B560-E6956A093ADE <> + 8 128 0 0 0 com.apple.kpi.private (22.3.0) 10E5D254-4A37-3A2A-B560-E6956A093ADE <> + 9 124 0 0 0 com.apple.kpi.unsupported (22.3.0) 10E5D254-4A37-3A2A-B560-E6956A093ADE <> + 10 16 0xffffff800367b000 0x78ff0 0x78ff0 com.apple.kec.corecrypto (12.0) CADEE2DB-DF62-3630-A9F9-BC8B75D43579 <9 8 7 6 3 1> + 11 0 0xffffff8001812000 0x3000 0x3000 com.apple.kec.AppleEncryptedArchive (1) 801B530A-4BDE-3DA7-A4EB-595E19C2183F <10 8 7 6> + 12 0 0xffffff8001d23000 0x1ffd 0x1ffd com.apple.kec.Compression (1) AAD85675-9300-3DD1-A6EE-DA2188B031A6 <10 8 7 6> + 207 0 0xffffff7f95ff2000 0x9ffc 0x9ffc com.apple.driver.AppleBridgeAudioController (300.10) 747999A0-EEDE-3055-9F27-45AAE351615D <17 9 8 7 6 3 1> + 208 0 0xffffff7f8d72b000 0x2ffb 0x2ffb com.apple.kext.AMDRadeonX6000HWServices (4.0.9) 18243619-48C2-3C79-A855-1845FF65D0F1 <147 17 16 9 7 6 3 1> + 209 0 0xffffff7f80fb5000 0x2ff8 0x2ff8 com.apple.kext.AMDRadeonServiceManager (4.0.9) 3376CF7B-83E6-39D4-BC79-1166F3D023C4 <17 6 3 1> + 210 0 0xffffff7f8d264000 0x171000 0x171000 com.apple.kext.AMDRadeonX6000 (4.0.9) 32106E48-FADE-38FC-A544-A410B04DE09E <153 147 97 17 9 7 6 3 1> + 211 0 0xffffff7f900ec000 0x3ab000 0x3ab000 com.apple.kext.AMDRadeonX6200HWLibs (1.0) 5C49C020-89C4-3C65-8241-C24606BB8721 <17 7 6 3 1> + 212 0 0xffffff7f95fcf000 0x3000 0x3000 com.apple.driver.AppleUpstreamUserClient (3.6.9) D87ECE3E-9289-3365-92B3-447D3CE3CF60 <147 17 16 9 7 6 3 1> + 213 0 0xffffff8001841000 0xffd 0xffd com.apple.driver.AppleHIDALSService (1) 3075C57F-90CA-3F66-A7D9-CE089F9B800A <25 6 3> + 214 0 0xffffff7f965e4000 0x8000 0x8000 com.apple.filesystems.autofs (3.0) CF00080B-43BD-3228-B53D-BE5A3E0DCC84 <188 9 8 7 6 3 2 1> + 215 0 0xffffff7f95fde000 0x3000 0x3000 com.apple.driver.AudioAUUC (1.70) 405B4B39-337C-3D86-945F-EF423DB76751 <200 147 17 16 9 7 6 3 1> + 216 1 0xffffff7f96320000 0x6000 0x6000 com.apple.driver.X86PlatformShim (1.0.0) E5997FC7-5A3F-389B-94A3-71E4363D3602 <158 140 18 9 6 3> + 217 0 0xffffff7f95228000 0x1eff9 0x1eff9 com.apple.driver.AGPM (131) 6E5501C1-EE76-3A48-B256-A706C1654080 <159 152 147 140 17 8 7 6 3 1> + 218 0 0xffffff7f95e9a000 0x1fff 0x1fff com.apple.driver.ApplePlatformEnabler (2.7.0d0) EBD0CB5E-069E-31D3-86AE-F50016424C39 <9 7 6 3> + 219 0 0xffffff800184c000 0x1000 0x1000 com.apple.driver.AppleBluetoothHIDKeyboard (231) 57781374-1C81-3943-8E43-F93A73C4F3D9 <130 126 58 6 3> + 221 0 0xffffff7f966ed000 0x81ff1 0x81ff1 com.apple.filesystems.smbfs (5.0) A47AE6DA-E8FF-3348-A45F-BC77C4A74D05 <188 10 9 8 7 6 3 1> + 222 1 0xffffff7f96601000 0xcff7 0xcff7 com.apple.filesystems.exfat (1.4) D13CB989-1F42-3002-865C-9F5ADB1BA635 <9 8 7 6 3 1> + 223 0 0xffffff7f965d6000 0xbffe 0xbffe com.apple.nke.asp_tcp (8.3) E4AD657A-2612-3AF4-B82B-504DD0F1DC42 <9 8 7 6 3 1> + 224 1 0xffffff7f95ebf000 0xc000 0xc000 com.apple.security.SecureRemotePassword (1.0) 3328BC1F-AE4D-33C3-87D0-BA29AE290DB2 <8 7 6 1> + 225 0 0xffffff7f96589000 0x45ff4 0x45ff4 com.apple.filesystems.afpfs (11.4) 3A234FAA-F76E-3CE3-8C49-53FF3924558E <224 95 9 8 7 6 3 1> diff --git a/test/assets/ls.01.txt b/test/assets/ls.01.txt new file mode 100644 index 0000000..8084ddd --- /dev/null +++ b/test/assets/ls.01.txt @@ -0,0 +1,6 @@ +total 1656 +-rw-r--r-- 1 james staff 2687 Oct 12 16:58 NativeTableParser.deps.json +-rw-r--r-- 1 james staff 12288 Oct 12 16:58 NativeTableParser.dll +-rw-r--r-- 1 james staff 14512 Oct 12 16:58 NativeTableParser.pdb +-rwxr--r-- 1 james staff 354304 Mar 7 2019 System.Management.Automation.dll +-rwxr--r-- 1 james staff 457864 Aug 19 12:49 System.Text.Json.dll diff --git a/test/assets/ls.02.txt b/test/assets/ls.02.txt new file mode 100644 index 0000000..caf9996 --- /dev/null +++ b/test/assets/ls.02.txt @@ -0,0 +1,6 @@ +total 1656 +-rw-r--r-- 1 james 2687 Oct 12 16:58 NativeTableParser.deps.json +-rw-r--r-- 1 james 12288 Oct 12 16:58 NativeTableParser.dll +-rw-r--r-- 1 james 14512 Oct 12 16:58 NativeTableParser.pdb +-rwxr--r-- 1 james 354304 Mar 7 2019 System.Management.Automation.dll +-rwxr--r-- 1 james 457864 Aug 19 12:49 System.Text.Json.dll diff --git a/test/assets/ls.03.txt b/test/assets/ls.03.txt new file mode 100644 index 0000000..ae53853 --- /dev/null +++ b/test/assets/ls.03.txt @@ -0,0 +1,6 @@ +total 1656 +-rw-r--r-- 1 2687 Oct 12 16:58 NativeTableParser.deps.json +-rw-r--r-- 1 12288 Oct 12 16:58 NativeTableParser.dll +-rw-r--r-- 1 14512 Oct 12 16:58 NativeTableParser.pdb +-rwxr--r-- 1 354304 Mar 7 2019 System.Management.Automation.dll +-rwxr--r-- 1 457864 Aug 19 12:49 System.Text.Json.dll diff --git a/test/assets/ps.01.txt b/test/assets/ps.01.txt new file mode 100644 index 0000000..ca3e5b9 --- /dev/null +++ b/test/assets/ps.01.txt @@ -0,0 +1,7 @@ + PID TTY TIME CMD + 2596 ttys000 1:59.45 /usr/local/bin/pwsh -l + 2601 ttys001 0:44.13 /usr/local/bin/pwsh -l + 2661 ttys002 0:23.53 /usr/local/bin/pwsh + 2669 ttys003 0:23.04 /usr/local/bin/pwsh + 2674 ttys004 0:23.32 /usr/local/bin/pwsh + 2676 ttys005 0:23.16 /usr/local/bin/pwsh diff --git a/test/assets/ps.02.txt b/test/assets/ps.02.txt new file mode 100644 index 0000000..94422f3 --- /dev/null +++ b/test/assets/ps.02.txt @@ -0,0 +1,89 @@ + UID PID PPID C STIME TTY TIME CMD + 0 1 0 0 9:34AM ?? 8:24.94 /sbin/launchd + 0 98 1 0 9:34AM ?? 1:54.65 /usr/libexec/logd + 0 99 1 0 9:34AM ?? 0:00.27 /usr/libexec/smd + 0 100 1 0 9:34AM ?? 0:06.71 /usr/libexec/UserEventAgent (System) + 0 103 1 0 9:34AM ?? 0:01.79 /System/Library/PrivateFrameworks/Uninstall.framework/Resources/uninstalld + 0 104 1 0 9:34AM ?? 17:16.62 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/Support/fseventsd + 0 105 1 0 9:34AM ?? 0:08.17 /System/Library/PrivateFrameworks/MediaRemote.framework/Support/mediaremoted + 0 107 1 0 9:34AM ?? 0:13.62 /usr/sbin/systemstats --daemon + 0 109 1 0 9:34AM ?? 0:10.76 /usr/libexec/configd + 0 110 1 0 9:34AM ?? 0:00.29 endpointsecurityd + 0 111 1 0 9:34AM ?? 1:46.52 /System/Library/CoreServices/powerd.bundle/powerd + 289 112 1 0 9:34AM ?? 0:02.96 /System/Library/PrivateFrameworks/BiomeStreams.framework/Support/biomed + 0 114 1 0 9:34AM ?? 0:03.86 /usr/libexec/amfid + 0 116 1 0 9:34AM ?? 0:08.00 /usr/libexec/remoted + 0 118 1 0 9:34AM ?? 0:00.04 /usr/libexec/keybagd -t 15 + 200 119 1 0 9:34AM ?? 0:00.57 /System/Library/PrivateFrameworks/MobileSoftwareUpdate.framework/Support/softwareupdated + 0 121 1 0 9:34AM ?? 0:02.85 /usr/libexec/watchdogd + 240 126 1 0 9:34AM ?? 0:01.15 /System/Library/CoreServices/iconservicesd + 0 127 1 0 9:34AM ?? 0:17.44 /usr/libexec/kernelmanagerd + 0 128 1 0 9:34AM ?? 0:05.77 /usr/libexec/diskarbitrationd + 0 132 1 0 9:34AM ?? 0:48.28 /usr/libexec/coreduetd + 0 133 1 0 9:34AM ?? 0:04.97 /usr/sbin/syslogd + 501 15257 1 0 11:28AM ?? 0:00.02 /System/Library/Frameworks/PCSC.framework/Versions/A/XPCServices/com.apple.ctkpcscd.xpc/Contents/MacOS/com.apple.ctkpcscd + 0 16834 1 0 11:47AM ?? 0:01.48 /System/Library/PrivateFrameworks/PackageKit.framework/Versions/A/XPCServices/package_script_service.xpc/Contents/MacOS/package_script_service + 501 16956 1 0 11:47AM ?? 0:00.25 /usr/libexec/appleaccountd + 501 19881 1 0 11:49AM ?? 0:00.65 /System/Library/PrivateFrameworks/Lookup.framework/Versions/A/XPCServices/LookupViewService.xpc/Contents/MacOS/LookupViewService + 501 19927 1 0 1:41AM ?? 0:01.68 /System/Library/PrivateFrameworks/PhotoAnalysis.framework/Versions/A/Support/photoanalysisd + 0 34545 1 0 4:56AM ?? 2:26.12 /System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Support/mds + 0 34546 1 0 4:56AM ?? 0:00.01 /System/Library/Frameworks/NetFS.framework/Versions/A/XPCServices/PlugInLibraryService.xpc/Contents/MacOS/PlugInLibraryService + 0 34547 1 0 4:56AM ?? 5:52.37 /System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Versions/A/Support/mds_stores + 89 34910 1 0 5:00AM ?? 0:11.79 /System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Versions/A/Support/mdworker -s mdworker-sizing -c MDSSizingWorker -m com.apple.mdworker.sizing + 501 35665 1 0 5:08AM ?? 0:00.37 /System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Versions/A/Support/mdworker -s mdworker-sizing -c MDSSizingWorker -m com.apple.mdworker.sizing + 0 36835 1 0 12:03PM ?? 0:00.01 /System/Library/Frameworks/NetFS.framework/Versions/A/XPCServices/PlugInLibraryService.xpc/Contents/MacOS/PlugInLibraryService + 501 36858 1 0 12:04PM ?? 0:00.05 /System/Library/PrivateFrameworks/KerberosHelper/Helpers/DiskUnmountWatcher + 501 36892 1 0 12:04PM ?? 0:00.10 /System/Library/Frameworks/Metal.framework/Versions/A/XPCServices/MTLCompilerService.xpc/Contents/MacOS/MTLCompilerService + 501 37656 1 0 12:10PM ?? 0:00.03 /System/Library/Frameworks/AudioToolbox.framework/XPCServices/com.apple.audio.SandboxHelper.xpc/Contents/MacOS/com.apple.audio.SandboxHelper + 499 37932 376 0 5:36AM ?? 35:05.96 /Applications/Microsoft Defender.app/Contents/MacOS/wdavdaemon_unprivileged.app/Contents/MacOS/wdavdaemon_unprivileged unprivileged 22 27 58 60 20 --log_level info + 501 38408 1 0 12:17PM ?? 0:01.27 /System/Cryptexes/App/System/Library/CoreServices/SafariSupport.bundle/Contents/MacOS/SafariBookmarksSyncAgent + 501 38426 1 0 12:17PM ?? 0:07.45 /usr/libexec/backgroundassets.user + 501 38451 1 0 12:18PM ?? 0:00.37 /usr/libexec/proactiveeventtrackerd + 501 43617 1 0 1:22PM ?? 0:00.33 /System/Library/CoreServices/rcd.app/Contents/MacOS/rcd + 501 46487 1 0 1:56PM ?? 0:00.90 /System/Library/Frameworks/QuickLookUI.framework/Versions/A/XPCServices/QuickLookUIService.xpc/Contents/MacOS/QuickLookUIService + 501 46519 1 0 1:56PM ?? 0:00.01 /System/Library/PrivateFrameworks/ToneLibrary.framework/Versions/A/XPCServices/com.apple.tonelibraryd.xpc/Contents/MacOS/com.apple.tonelibraryd + 501 48190 1 0 2:12PM ?? 0:10.33 /Applications/Docker.app/Contents/MacOS/Docker + 501 48191 48190 0 2:12PM ?? 3:09.64 /Applications/Docker.app/Contents/MacOS/com.docker.backend -watchdog -native-api + 501 48197 48191 0 2:12PM ?? 0:02.30 /Applications/Docker.app/Contents/MacOS/com.docker.backend -watchdog -native-api + 501 48228 48191 0 2:12PM ?? 0:29.18 /Applications/Docker.app/Contents/MacOS/Docker Desktop.app/Contents/MacOS/Docker Desktop --name=dashboard + 501 48247 48191 0 2:12PM ?? 0:04.36 vpnkit-bridge --disable wsl2-cross-distro-service,wsl2-bootstrap-expose-ports,transfused,osxfs-data --addr-fd fd:3 --addr unix+listen+fd:// host + 501 48248 48191 0 2:12PM ?? 0:01.62 com.docker.driver.amd64-linux -addr fd:3 -debug -native-api + 501 48249 48191 0 2:12PM ?? 0:03.22 com.docker.extensions -address extension-manager.sock -watchdog + 501 48250 48191 0 2:12PM ?? 0:00.81 com.docker.dev-envs + 501 48251 48244 0 2:12PM ?? 0:00.00 + 501 48273 1 0 2:12PM ?? 35:30.06 /System/Library/Frameworks/Virtualization.framework/Versions/A/XPCServices/com.apple.Virtualization.VirtualMachine.xpc/Contents/MacOS/com.apple.Virtualization.VirtualMachine + 501 48278 1 0 2:12PM ?? 0:00.09 /System/Library/Frameworks/VideoToolbox.framework/Versions/A/XPCServices/VTDecoderXPCService.xpc/Contents/MacOS/VTDecoderXPCService + 501 54642 1 0 2:35PM ?? 0:00.39 /System/Library/Frameworks/QuickLook.framework/Versions/A/XPCServices/ExternalQuickLookSatellite-x86_64.xpc/Contents/MacOS/ExternalQuickLookSatellite-x86_64 + 501 56167 1 0 2:54PM ?? 0:00.03 /System/Library/Frameworks/AudioToolbox.framework/XPCServices/com.apple.audio.SandboxHelper.xpc/Contents/MacOS/com.apple.audio.SandboxHelper + 501 56184 1 0 2:54PM ?? 0:01.26 /System/Library/PrivateFrameworks/CallHistory.framework/Support/CallHistorySyncHelper + 0 58795 1 0 3:24PM ?? 0:00.11 /usr/libexec/dprivacyd + 0 60829 1 0 3:50PM ?? 0:00.02 /Library/Apple/System/Library/CoreServices/XProtect.app/Contents/MacOS/XProtect + 0 60830 1 0 3:50PM ?? 0:02.14 /Library/Apple/System/Library/CoreServices/XProtect.app/Contents/XPCServices/XProtectPluginService.xpc/Contents/MacOS/XProtectPluginService + 501 60834 1 0 3:50PM ?? 0:00.02 /Library/Apple/System/Library/CoreServices/XProtect.app/Contents/MacOS/XProtect + 501 60835 1 0 3:50PM ?? 0:01.99 /Library/Apple/System/Library/CoreServices/XProtect.app/Contents/XPCServices/XProtectPluginService.xpc/Contents/MacOS/XProtectPluginService + 501 61051 1 0 3:52PM ?? 0:00.21 /System/Applications/Messages.app/Contents/PlugIns/MobileSMSSpotlightImporterCatalyst.appex/Contents/MacOS/MobileSMSSpotlightImporterCatalyst -AppleLanguages ("en-US") + 501 61052 1 0 3:52PM ?? 0:00.56 /System/Library/PrivateFrameworks/MediaConversionService.framework/Versions/A/XPCServices/com.apple.photos.ImageConversionService.xpc/Contents/MacOS/com.apple.photos.ImageConversionService + 501 61053 1 0 3:52PM ?? 0:00.59 /System/Library/PrivateFrameworks/MessagesBlastDoorSupport.framework/Versions/A/XPCServices/MessagesBlastDoorService.xpc/Contents/MacOS/MessagesBlastDoorService + 501 62406 1 0 4:10PM ?? 0:00.11 /System/Library/CoreServices/OSDUIHelper.app/Contents/MacOS/OSDUIHelper + 501 68318 1 0 8:09AM ?? 0:00.71 /usr/libexec/remindd + 501 69604 1 0 8:24AM ?? 0:00.05 /System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Versions/A/Support/mdworker_shared -s mdworker -c MDSImporterWorker -m com.apple.mdworker.shared + 501 69735 1 0 8:24AM ?? 0:00.05 /System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Versions/A/Support/mdworker_shared -s mdworker -c MDSImporterWorker -m com.apple.mdworker.shared + 501 69769 1 0 8:25AM ?? 0:00.05 /System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Versions/A/Support/mdworker_shared -s mdworker -c MDSImporterWorker -m com.apple.mdworker.shared + 0 69827 1 0 8:25AM ?? 0:00.01 /System/Library/PrivateFrameworks/UserFS.framework/livefileproviderd + 501 69998 1 0 5:42PM ?? 0:00.06 /System/Library/PrivateFrameworks/IMDPersistence.framework/IMAutomaticHistoryDeletionAgent.app/Contents/MacOS/IMAutomaticHistoryDeletionAgent + 501 75548 1 0 6:54PM ?? 0:03.61 /System/Library/PrivateFrameworks/IntelligencePlatformCore.framework/Versions/A/knowledgeconstructiond + 501 82319 1 0 8:21PM ?? 0:00.01 /System/Library/Frameworks/NetFS.framework/Versions/A/XPCServices/PlugInLibraryService.xpc/Contents/MacOS/PlugInLibraryService + 0 87412 1 0 9:28PM ?? 0:00.02 /usr/libexec/griddatad + 501 87439 1 0 9:28PM ?? 0:00.03 /System/Library/PrivateFrameworks/DeviceCheckInternal.framework/devicecheckd + 501 87490 1 0 9:28PM ?? 0:00.10 /System/Library/CoreServices/EscrowSecurityAlert.app/Contents/MacOS/EscrowSecurityAlert + 0 87536 1 0 9:29PM ?? 0:00.01 /usr/libexec/periodic-wrapper daily + 0 87692 1 0 9:30PM ?? 0:00.15 /usr/libexec/applessdstatistics + 0 87749 1 0 9:30PM ?? 0:00.03 /usr/bin/sysdiagnose + 501 87806 1 0 9:31PM ?? 0:00.05 /usr/libexec/proactived + 501 2596 2587 0 9:45AM ttys000 2:00.20 /usr/local/bin/pwsh -l + 0 69835 2596 0 8:25AM ttys000 0:00.01 /bin/ps -ef + 501 2601 2597 0 9:45AM ttys001 0:44.13 /usr/local/bin/pwsh -l + 501 2661 2658 0 9:45AM ttys002 0:23.54 /usr/local/bin/pwsh + 501 2669 2658 0 9:45AM ttys003 0:23.04 /usr/local/bin/pwsh + 501 2674 2658 0 9:45AM ttys004 0:23.32 /usr/local/bin/pwsh + 501 2676 2658 0 9:45AM ttys005 0:23.16 /usr/local/bin/pwsh diff --git a/test/assets/ps.03.txt b/test/assets/ps.03.txt new file mode 100644 index 0000000..ffc0d27 --- /dev/null +++ b/test/assets/ps.03.txt @@ -0,0 +1,7 @@ + UID PID PPID F CPU PRI NI SZ RSS WCHAN S ADDR TTY TIME CMD + 501 2596 2587 4006 0 33 0 39662748 167544 - S+ 0 ttys000 2:01.35 /usr/local/bin/pwsh -l + 501 2601 2597 4006 0 33 0 39659028 142632 - S+ 0 ttys001 0:44.13 /usr/local/bin/pwsh -l + 501 2661 2658 4006 0 33 0 39657836 135988 - Ss+ 0 ttys002 0:23.54 /usr/local/bin/pwsh + 501 2669 2658 4006 0 33 0 39658348 135396 - Ss+ 0 ttys003 0:23.05 /usr/local/bin/pwsh + 501 2674 2658 4006 0 33 0 39658348 136844 - Ss+ 0 ttys004 0:23.32 /usr/local/bin/pwsh + 501 2676 2658 4006 0 33 0 39658344 136596 - Ss+ 0 ttys005 0:23.17 /usr/local/bin/pwsh diff --git a/test/assets/ps.04.txt b/test/assets/ps.04.txt new file mode 100644 index 0000000..590f435 --- /dev/null +++ b/test/assets/ps.04.txt @@ -0,0 +1,786 @@ + PID TTY TIME CMD + 1 ?? 10:14.30 launchd + 98 ?? 2:22.73 logd + 99 ?? 0:00.32 smd + 100 ?? 0:07.62 UserEventAgent + 103 ?? 0:02.18 uninstalld + 104 ?? 19:06.64 fseventsd + 105 ?? 0:11.72 mediaremoted + 107 ?? 0:16.55 systemstats + 109 ?? 0:12.40 configd + 110 ?? 0:00.33 endpointsecurityd + 111 ?? 2:16.74 powerd + 112 ?? 0:03.55 biomed + 114 ?? 0:04.27 amfid + 116 ?? 0:09.78 remoted + 118 ?? 0:00.04 keybagd + 119 ?? 0:00.67 softwareupdated + 121 ?? 0:03.45 watchdogd + 126 ?? 0:01.21 iconservicesd + 127 ?? 0:17.47 kernelmanagerd + 128 ?? 0:07.12 diskarbitrationd + 132 ?? 1:08.84 coreduetd + 133 ?? 0:05.66 syslogd + 136 ?? 0:00.02 thermalmonitord + 137 ?? 1:42.61 opendirectoryd + 138 ?? 0:07.52 apsd + 139 ?? 3:12.00 launchservicesd + 140 ?? 0:00.93 timed + 141 ?? 0:00.80 usbmuxd + 142 ?? 0:14.69 securityd + 143 ?? 0:00.01 auditd + 147 ?? 0:00.04 autofsd + 148 ?? 0:00.58 displaypolicyd + 149 ?? 0:25.19 dasd + 152 ?? 0:26.94 distnoted + 153 ?? 0:00.06 AppleCredentialManagerDaemon + 155 ?? 0:00.02 dirhelper + 156 ?? 0:00.11 logind + 157 ?? 0:00.31 revisiond + 158 ?? 0:00.02 KernelEventAgent + 159 ?? 0:03.59 usermanagerd + 162 ?? 3:32.80 notifyd + 163 ?? 0:06.75 sandboxd + 164 ?? 0:05.84 corebrightnessd + 165 ?? 0:02.17 AirPlayXPCHelper + 166 ?? 0:00.74 com.apple.cmio.registerassistantservice + 168 ?? 1:00.54 cfprefsd + 169 ?? 5:00.20 syspolicyd + 170 ?? 0:02.14 logd_helper + 171 ?? 0:00.05 aslmanager + 172 ?? 188:45.35 WindowServer + 173 ?? 0:45.10 tccd + 178 ?? 0:20.43 analyticsd + 195 ?? 0:03.15 authd + 209 ?? 1:04.69 runningboardd + 212 ?? 0:00.31 sysextd + 214 ?? 1:33.11 lsd + 215 ?? 0:05.67 coreservicesd + 224 ?? 0:01.99 distnoted + 233 ?? 0:20.19 loginwindow + 240 ?? 1:10.13 mDNSResponder + 243 ?? 0:02.08 distnoted + 247 ?? 0:01.56 backgroundtaskmanagementd + 248 ?? 1:20.21 trustd + 258 ?? 0:00.01 multiversed + 259 ?? 0:00.04 com.apple.ifdreader + 262 ?? 0:09.03 nehelper + 263 ?? 0:06.85 nsurlsessiond + 264 ?? 0:00.06 apfsd + 266 ?? 0:00.05 trustdFileHelper + 268 ?? 0:20.70 airportd + 274 ?? 0:16.27 contextstored + 276 ?? 100:00.33 coreaudiod + 278 ?? 0:00.09 usbd + 279 ?? 0:00.02 installerdiagwatcher + 280 ?? 1:02.34 ioupsd + 282 ?? 0:00.02 ethcheck + 283 ?? 0:00.10 VDCAssistant + 287 ?? 0:00.01 csnameddatad + 288 ?? 104:43.99 backupd + 291 ?? 0:00.54 nesessionmanager + 292 ?? 0:02.15 distnoted + 293 ?? 0:00.10 systemstatusd + 294 ?? 0:00.06 awdd + 295 ?? 1:10.40 mobileassetd + 297 ?? 0:40.05 symptomsd + 298 ?? 0:00.05 cryptexd + 299 ?? 0:00.03 tzd + 300 ?? 0:01.42 com.apple.CodeSigningHelper + 302 ?? 0:00.03 PowerUIAgent + 303 ?? 0:02.95 mDNSResponderHelper + 306 ?? 0:02.85 distnoted + 307 ?? 0:02.58 com.apple.geod + 308 ?? 0:17.12 softwareupdated + 309 ?? 0:00.14 cron + 310 ?? 0:00.16 secinitd + 311 ?? 0:00.04 cfprefsd + 312 ?? 0:00.33 trustd + 314 ?? 0:00.65 findmydeviced + 315 ?? 0:02.22 distnoted + 316 ?? 0:00.61 com.apple.MobileSoftwareUpdate.CleanupPreparePathService + 317 ?? 0:00.05 containermanagerd + 328 ?? 0:02.26 distnoted + 337 ?? 0:16.49 backupd-helper + 345 ?? 3:39.31 UVCAssistant + 346 ?? 0:00.09 containermanagerd + 347 ?? 0:00.04 suhelperd + 348 ?? 0:00.19 wifip2pd + 351 ?? 0:01.69 diskmanagementd + 353 ?? 0:00.02 WiFiCloudAssetsXPCService + 357 ?? 0:21.14 storagekitd + 359 ?? 0:41.32 Core Audio Driver (MSTeamsAudioDevice.driver) + 362 ?? 0:00.07 writeconfig + 366 ?? 0:00.37 aned + 367 ?? 0:21.84 locationd + 368 ?? 0:02.46 iconservicesagent + 369 ?? 3:21.98 XprotectService + 370 ?? 0:00.04 containermanagerd + 372 ?? 0:00.07 AudioComponentRegistrar + 376 ?? 79:51.65 wdavdaemon + 378 ?? 1:14.22 com.spitfireaudio.LibraryManagerHelper + 380 ?? 17:16.27 dlpdaemon + 382 ?? 0:04.57 IntuneMdmDaemon + 384 ?? 0:13.85 licenseDaemon + 385 ?? 14:27.18 epsext + 393 ?? 0:00.03 com.apple.audio.SandboxHelper + 394 ?? 0:21.24 searchpartyd + 400 ?? 0:35.74 Core Audio Driver (ZoomAudioDevice.driver) + 409 ?? 0:02.86 rtcreportingd + 413 ?? 0:00.02 ReportCrash + 448 ?? 1:26.78 netext + 465 ?? 0:00.14 com.apple.audio.DriverHelper + 468 ?? 0:33.72 audioclocksyncd + 469 ?? 0:00.85 coresymbolicationd + 483 ?? 0:00.55 aceagent + 492 ?? 0:00.16 kdc + 499 ?? 0:02.31 distnoted + 501 ?? 0:00.38 secinitd + 504 ?? 0:01.07 netbiosd + 505 ?? 0:00.60 corekdld + 506 ?? 0:00.52 bosUpdateProxy + 507 ?? 0:00.79 SubmitDiagInfo + 509 ?? 85:12.03 wdavdaemon_enterprise + 510 ?? 0:00.03 CVMServer + 511 ?? 0:02.25 distnoted + 516 ?? 0:00.02 com.apple.DriverKit-IOUserDockChannelSerial + 517 ?? 2:14.10 com.apple.DriverKit.AppleUserECM + 518 ?? 15:21.73 com.apple.AppleUserHIDDrivers + 519 ?? 0:00.01 com.apple.DriverKit.AppleUserECM + 525 ?? 1:19.62 telemetryd_v2 + 526 ?? 0:00.09 siriinferenced + 530 ?? 2:48.62 dlp_agent + 535 ?? 0:00.19 securityd_service + 537 ?? 0:02.20 distnoted + 538 ?? 0:41.10 CAReportingService + 540 ?? 0:00.34 thermald + 556 ?? 0:02.80 distnoted + 561 ?? 0:00.13 hidd + 568 ?? 0:02.08 distnoted + 570 ?? 0:24.24 lsd + 572 ?? 0:00.01 csnameddatad + 573 ?? 0:01.89 trustd + 574 ?? 0:00.37 wifianalyticsd + 579 ?? 0:00.03 BlueTool + 587 ?? 0:00.76 mobileactivationd + 603 ?? 0:00.05 appinstalld + 604 ?? 0:00.02 com.apple.MobileInstallationHelperService + 605 ?? 0:02.03 distnoted + 607 ?? 0:00.06 secd + 610 ?? 0:00.05 online-authd + 615 ?? 0:00.21 colorsync.displayservices + 616 ?? 0:00.02 com.apple.ColorSyncXPCAgent + 617 ?? 0:00.09 colorsyncd + 618 ?? 0:00.59 MTLCompilerService + 619 ?? 9:34.15 sysmond + 620 ?? 0:01.13 appleeventsd + 622 ?? 0:00.21 symptomsd-diag + 623 ?? 0:00.71 systemstats + 624 ?? 0:00.20 sharedfilelistd + 625 ?? 0:00.03 bootinstalld + 639 ?? 0:00.04 com.apple.AccountPolicyHelper + 654 ?? 0:00.08 coreauthd + 655 ?? 0:00.09 AppSSODaemon + 657 ?? 0:00.83 biometrickitd + 658 ?? 0:54.23 distnoted + 662 ?? 1:03.48 secd + 663 ?? 12:51.25 cfprefsd + 664 ?? 0:00.31 TrustedPeersHelper + 667 ?? 0:04.29 com.apple.AmbientDisplayAgent + 668 ?? 0:00.01 com.apple.ColorSyncXPCAgent + 672 ?? 0:20.26 UserEventAgent + 673 ?? 0:04.15 gamecontrollerd + 674 ?? 2:05.72 ContinuityCaptureAgent + 675 ?? 2:12.29 knowledge-agent + 679 ?? 0:01.14 com.apple.sbd + 680 ?? 0:01.82 universalaccessd + 682 ?? 0:00.66 BackgroundTaskManagementAgent + 683 ?? 1:05.60 lsd + 684 ?? 0:54.49 AXVisualSupportAgent + 685 ?? 0:36.08 tccd + 686 ?? 0:57.23 rapportd + 687 ?? 0:00.02 csnameddatad + 688 ?? 1:45.51 trustd + 689 ?? 0:28.90 accountsd + 690 ?? 0:04.28 homed + 693 ?? 0:00.64 pboard + 694 ?? 0:14.22 identityservicesd + 695 ?? 0:01.90 distnoted + 696 ?? 0:03.06 usernoted + 698 ?? 0:04.44 donotdisturbd + 699 ?? 0:11.34 containermanagerd + 700 ?? 0:19.59 BiomeAgent + 701 ?? 1:15.76 nearbyd + 702 ?? 0:03.66 WirelessRadioManagerd + 703 ?? 3:37.11 ControlCenter + 704 ?? 0:21.77 ContextStoreAgent + 705 ?? 1:19.68 sharingd + 706 ?? 0:03.16 gamecontrolleragentd + 710 ?? 0:00.05 followupd + 712 ?? 0:25.82 secinitd + 714 ?? 1:35.29 contactsd + 715 ?? 0:01.60 sharedfilelistd + 718 ?? 0:04.67 bird + 720 ?? 0:00.49 ScreenTimeAgent + 721 ?? 0:51.38 WindowManager + 723 ?? 0:18.79 cloudd + 724 ?? 0:03.60 filecoordinationd + 725 ?? 1:02.10 fileproviderd + 729 ?? 0:22.44 nsurlsessiond + 730 ?? 0:00.01 com.apple.DictionaryServiceHelper + 731 ?? 0:00.27 keyboardservicesd + 735 ?? 0:00.94 dmd + 736 ?? 0:09.67 pkd + 738 ?? 0:01.66 familycircled + 739 ?? 0:43.48 axassetsd + 740 ?? 0:02.08 pbs + 742 ?? 0:00.52 AudioComponentRegistrar + 744 ?? 0:01.02 systemsoundserverd + 746 ?? 0:02.82 akd + 750 ?? 0:00.03 USBAgent + 752 ?? 0:01.60 adid + 755 ?? 0:28.56 spindump + 756 ?? 0:00.01 spindump_agent + 757 ?? 0:00.80 cdpd + 758 ?? 0:00.20 CarbonComponentScannerXPC + 768 ?? 0:00.82 talagent + 769 ?? 0:00.01 PlugInLibraryService + 770 ?? 0:01.39 siriactionsd + 771 ?? 0:01.08 CoreLocationAgent + 772 ?? 0:11.11 calaccessd + 774 ?? 0:01.89 distnoted + 775 ?? 0:09.89 syncdefaultsd + 776 ?? 0:03.12 transparencyd + 777 ?? 0:00.32 ctkd + 778 ?? 0:02.97 CommCenter + 779 ?? 25:47.12 corespotlightd + 780 ?? 0:15.18 NotificationCenter + 781 ?? 0:00.03 APFSUserAgent + 783 ?? 0:35.20 fontd + 784 ?? 0:06.55 routined + 786 ?? 0:00.80 WiFiAgent + 787 ?? 0:01.07 fontworker + 788 ?? 0:10.59 callservicesd + 789 ?? 0:03.04 appstored + 790 ?? 0:02.39 ContextService + 791 ?? 0:00.08 replayd + 792 ?? 0:01.74 sociallayerd + 793 ?? 0:12.42 iconservicesagent + 794 ?? 0:02.52 com.apple.hiservices-xpcservice + 795 ?? 7:09.68 suggestd + 796 ?? 0:06.67 com.apple.geod + 798 ?? 0:01.82 fmfd + 800 ?? 0:02.16 mobiletimerd + 801 ?? 0:05.40 ViewBridgeAuxiliary + 802 ?? 0:00.99 CoreServicesUIAgent + 803 ?? 0:04.02 ContainerMetadataExtractor + 804 ?? 0:00.01 LoginUserService + 806 ?? 0:00.24 Keychain Circle Notification + 807 ?? 0:00.13 ProtectedCloudKeySyncing + 809 ?? 0:00.86 com.apple.StreamingUnzipService + 810 ?? 0:00.24 CloudKeychainProxy + 811 ?? 0:01.77 neagent + 813 ?? 0:00.74 akd + 814 ?? 0:01.02 AssetCacheLocatorService + 815 ?? 0:00.05 installcoordinationd + 816 ?? 0:00.07 AssetCache + 817 ?? 0:01.84 distnoted + 818 ?? 0:00.05 AssetCacheTetheratorService + 819 ?? 0:02.01 AppSSOAgent + 821 ?? 0:07.69 CMFSyncAgent + 833 ?? 0:04.66 progressd + 836 ?? 0:04.07 amsaccountsd + 838 ?? 0:14.76 amsengagementd + 844 ?? 0:01.38 com.apple.CloudPhotosConfiguration + 845 ?? 0:01.16 iCloudNotificationAgent + 847 ?? 0:08.20 networkserviceproxy + 848 ?? 5:02.97 photolibraryd + 849 ?? 0:00.30 SoftwareUpdateNotificationManager + 851 ?? 0:01.56 ScopedBookmarkAgent + 854 ?? 0:00.28 nfcd + 863 ?? 0:00.05 seld + 873 ?? 0:01.80 distnoted + 875 ?? 0:00.70 cloudphotod + 877 ?? 0:00.81 cloudpaird + 879 ?? 0:00.57 remotemanagementd + 885 ?? 0:00.05 InteractiveLegacyProfilesSubscriber + 886 ?? 0:01.80 distnoted + 887 ?? 0:00.04 LegacyProfilesSubscriber + 888 ?? 0:00.04 PasscodeSettingsSubscriber + 890 ?? 0:00.03 AccountSubscriber + 891 ?? 0:00.03 ManagementTestSubscriber + 892 ?? 0:00.01 PlugInLibraryService + 893 ?? 0:00.14 XProtectBehaviorService + 894 ?? 0:56.66 mdbulkimport + 895 ?? 0:09.11 swcd + 897 ?? 0:21.06 assistantd + 898 ?? 0:01.37 linkd + 899 ?? 0:00.03 com.apple.audio.ComponentTagHelper + 900 ?? 0:17.87 siriknowledged + 901 ?? 0:00.03 ctkd + 902 ?? 0:00.27 coreauthd + 904 ?? 0:00.08 extensionkitservice + 905 ?? 0:01.36 com.apple.siri.embeddedspeech + 906 ?? 0:00.17 FindMyWidgetItems + 907 ?? 0:00.08 PhotosReliveWidget + 908 ?? 0:00.45 NewsToday2 + 909 ?? 0:00.10 com.apple.Notes.WidgetExtension + 910 ?? 0:00.10 CalendarWidgetExtension + 912 ?? 0:00.17 WeatherWidget + 913 ?? 0:05.05 triald + 914 ?? 0:00.12 PodcastsWidget + 915 ?? 0:00.10 RemindersWidgetExtension + 916 ?? 0:00.12 FindMyWidgetPeople + 917 ?? 0:00.12 StocksWidget + 918 ?? 0:00.05 TipsAppWidget-macOSExtension + 919 ?? 0:00.11 ScreenTimeWidgetExtension + 920 ?? 0:00.09 HomeWidget + 921 ?? 0:00.13 WorldClockWidget + 923 ?? 0:00.42 NewsTag + 924 ?? 0:00.70 StatusKitAgent + 925 ?? 0:03.96 imagent + 926 ?? 0:00.13 com.apple.FaceTime.FTConversationService + 927 ?? 9:36.72 IMDPersistenceAgent + 928 ?? 0:00.10 GSSCred + 929 ?? 0:19.02 useractivityd + 930 ?? 0:00.51 mediaremoteagent + 931 ?? 0:08.77 avconferenced + 932 ?? 0:00.99 SidecarRelay + 933 ?? 1:11.40 UniversalControl + 934 ?? 0:13.46 biomesyncd + 941 ?? 0:00.06 mediasharingd + 943 ?? 0:15.29 deleted + 950 ?? 0:01.64 com.apple.siri.embeddedspeech + 955 ?? 0:09.75 searchpartyuseragent + 956 ?? 0:00.73 UIKitSystem + 959 ?? 0:00.12 fairplayd + 961 ?? 0:00.01 ReportCrash + 968 ?? 0:00.50 RemoteManagementAgent + 969 ?? 0:00.06 InteractiveLegacyProfilesSubscriber + 970 ?? 0:00.04 LegacyProfilesSubscriber + 971 ?? 0:00.04 PasscodeSettingsSubscriber + 972 ?? 0:00.05 AccountSubscriber + 973 ?? 0:00.03 ManagementTestSubscriber + 980 ?? 0:01.45 csimporter + 1013 ?? 0:13.12 trustd + 1014 ?? 0:47.46 mdbulkimport + 1017 ?? 0:00.01 csnameddatad + 1048 ?? 0:00.13 containermanagerd + 1062 ?? 0:08.45 Google Chrome Helper (Renderer) + 1064 ?? 0:00.46 maild + 1066 ?? 0:00.50 financed + 1067 ?? 0:00.03 extensionkitservice + 1069 ?? 0:00.04 CalendarFocusConfigurationExtension + 1070 ?? 0:00.05 SafariLinkExtension + 1071 ?? 0:00.03 MailShortcutsExtension + 1072 ?? 0:00.03 MessagesActionExtension + 1079 ?? 0:00.34 UsageTrackingAgent + 1080 ?? 0:01.85 adprivacyd + 1082 ?? 0:17.43 corespeechd + 1083 ?? 0:00.83 com.apple.siri.embeddedspeech + 1084 ?? 2:10.78 assistant_service + 1088 ?? 0:01.33 parsecd + 1090 ?? 0:10.90 itunescloudd + 1165 ?? 0:01.23 ndoagent + 1187 ?? 0:00.18 diagnosticextensionsd + 1188 ?? 0:10.36 CoreSpotlightService + 1221 ?? 0:00.44 avatarsd + 1298 ?? 0:00.01 installerdiagd + 1314 ?? 0:00.37 intelligenceplatformd + 1325 ?? 0:00.34 sirittsd + 1326 ?? 0:10.93 MTLAssetUpgraderD + 1333 ?? 0:03.22 com.apple.quicklook.ThumbnailsAgent + 1334 ?? 0:01.22 ThumbnailExtension_macOS + 1335 ?? 0:03.88 QuickLookSatellite + 1339 ?? 4:07.68 Mail + 1348 ?? 0:00.04 ASPCarryLog + 1349 ?? 0:09.16 appstoreagent + 1350 ?? 0:00.03 metrickitd + 1351 ?? 0:00.03 com.apple.AppStoreDaemon.StorePrivilegedTaskService + 1352 ?? 0:01.10 promotedcontentd + 1357 ?? 0:03.52 osanalyticshelper + 1358 ?? 0:01.41 diagnostics_agent + 1359 ?? 0:00.02 CrashReporterSupportHelper + 1555 ?? 0:00.03 localizationswitcherd + 1597 ?? 0:00.52 mapspushd + 1603 ?? 0:00.02 spotlightknowledged + 1612 ?? 2:50.70 media-indexer + 1615 ?? 2:29.08 AMPLibraryAgent + 1621 ?? 0:00.08 PodcastContentService + 1622 ?? 0:00.16 com.apple.BKAgentService + 1623 ?? 0:00.08 com.apple.audio.SandboxHelper + 1624 ?? 0:00.19 AMPArtworkAgent + 1625 ?? 0:00.03 mlruntimed + 2165 ?? 0:00.02 microstackshot + 2403 ?? 0:16.16 Spotlight + 2404 ?? 0:02.02 commerce + 2515 ?? 0:03.75 System Settings + 2517 ?? 6:27.97 Teams + 2521 ?? 5:20.45 Terminal + 2523 ?? 6:01.88 Music + 2524 ?? 15:11.31 Microsoft Remote Desktop + 2525 ?? 10:51.71 Messages + 2527 ?? 7:54.41 Activity Monitor + 2528 ?? 6:05.01 Microsoft Edge + 2529 ?? 1:29.90 iTerm2 + 2533 ?? 0:53.53 Dock + 2534 ?? 3:16.14 SystemUIServer + 2535 ?? 8:58.44 Finder + 2540 ?? 0:00.36 QuickLookUIService + 2549 ?? 0:00.04 automountd + 2551 ?? 0:00.08 extensionkitservice + 2552 ?? 0:00.25 VTDecoderXPCService + 2553 ?? 0:00.27 AMPDeviceDiscoveryAgent + 2555 ?? 0:00.24 ACCFinderSync + 2556 ?? 0:00.25 deleted_helper + 2557 ?? 0:00.92 Appearance + 2560 ?? 0:00.10 ctkahp + 2561 ?? 0:00.06 ctkahp + 2563 ?? 0:00.20 imklaunchagent + 2564 ?? 0:00.07 geodMachServiceBridge + 2565 ?? 0:27.79 installd + 2566 ?? 0:00.11 storedownloadd + 2567 ?? 0:00.71 cloudd + 2568 ?? 0:00.09 system_installd + 2572 ?? 0:01.27 PAH_Extension + 2573 ?? 0:00.44 UserNotificationCenter + 2575 ?? 0:00.27 TextInputSwitcher + 2576 ?? 0:06.88 AppleIDSettings + 2580 ?? 0:00.08 PlugInLibraryService + 2581 ?? 0:00.26 colorsync.useragent + 2582 ?? 0:00.01 com.apple.ColorSyncXPCAgent + 2583 ?? 0:00.02 SafeEjectGPUAgent + 2584 ?? 0:00.03 SafeEjectGPUService + 2586 ?? 0:00.62 contentlinkingd + 2588 ?? 0:00.04 com.apple.audio.SandboxHelper + 2589 ?? 0:00.01 com.apple.HasTRB + 2590 ?? 0:02.41 OneDrive File Provider + 2591 ?? 0:00.42 Touch ID & Password + 2592 ?? 0:00.49 HeadphoneSettingsExtension + 2593 ?? 0:48.20 PowerPreferences + 2594 ?? 0:00.39 FollowUpSettingsExtension + 2595 ?? 0:02.04 FamilySettings + 2598 ?? 0:00.43 TrackpadExtension + 2600 ?? 0:00.40 ClassKitSettings + 2604 ?? 0:28.93 dataaccessd + 2608 ?? 0:00.05 AssetCacheManagerService + 2609 ?? 0:00.38 VisualizerService + 2610 ?? 0:00.08 storelegacy + 2611 ?? 0:00.45 WalletSettingsExtension + 2613 ?? 0:00.73 storeuid + 2614 ?? 0:00.73 ClassroomSettings + 2625 ?? 0:03.80 studentd + 2631 ?? 0:00.46 MouseExtension + 2632 ?? 0:00.34 recentsd + 2634 ?? 0:03.12 com.apple.dock.extra + 2635 ?? 0:07.67 com.apple.WebKit.WebContent + 2636 ?? 0:00.06 com.apple.accessibility.mediaaccessibilityd + 2637 ?? 0:00.05 com.apple.audio.SandboxHelper + 2639 ?? 0:00.13 QuickLookSatellite + 2640 ?? 0:01.28 reversetemplated + 2641 ?? 0:01.76 com.apple.WebKit.Networking + 2642 ?? 0:00.90 CallHistoryPluginHelper + 2644 ?? 0:01.59 passd + 2646 ?? 1:14.13 com.apple.Safari.SafeBrowsing.Service + 2648 ?? 0:00.07 msedge_crashpad_handler + 2651 ?? 0:00.01 PlugInLibraryService + 2654 ?? 0:00.77 peopled + 2657 ?? 0:00.40 VPN + 2658 ?? 0:00.02 iTermServer-3.4.19 + 2660 ?? 0:04.46 gamed + 2662 ?? 1:59.13 Microsoft Edge Helper (GPU) + 2664 ?? 2:02.89 Microsoft Edge Helper + 2665 ?? 0:00.07 chrome_crashpad_handler + 2670 ?? 0:01.65 pwSafe + 2675 ?? 0:00.44 GameControllerMacSettings + 2678 ?? 0:10.15 Microsoft Edge Helper + 2680 ?? 40:51.88 Microsoft Teams Helper (GPU) + 2685 ?? 0:00.02 misagent + 2686 ?? 0:01.59 VTDecoderXPCService + 2687 ?? 0:24.04 Microsoft Teams Helper + 2688 ?? 0:00.02 pidinfo + 2689 ?? 0:00.15 VTDecoderXPCService + 2692 ?? 0:02.20 storekitagent + 2694 ?? 0:00.09 SafariLaunchAgent + 2698 ?? 0:01.75 Microsoft Edge Helper (Renderer) + 2699 ?? 0:00.02 PlugInLibraryService + 2704 ?? 0:00.71 Microsoft Teams Helper (Renderer) + 2708 ?? 0:01.72 Microsoft Edge Helper (Renderer) + 2710 ?? 0:05.94 Microsoft Edge Helper (Renderer) + 2711 ?? 0:00.43 CDs & DVDs Settings Extension + 2716 ?? 0:01.14 lskdd + 2718 ?? 0:02.64 com.apple.appkit.xpc.openAndSavePanelService + 2719 ?? 0:02.27 Microsoft Teams Helper + 2721 ?? 0:00.15 VTEncoderXPCService + 2723 ?? 0:00.40 QuickLookUIService + 2727 ?? 39:30.76 Microsoft Teams Helper (Renderer) + 2733 ?? 0:08.06 AppleSpell + 2734 ?? 0:00.93 naturallanguaged + 2737 ?? 0:14.86 heard + 2739 ?? 0:01.59 IntuneMdmAgent + 2741 ?? 0:08.76 Microsoft Defender Helper + 2744 ?? 0:47.33 PanGPS + 2746 ?? 0:28.45 ChromaCamHelper + 2748 ?? 0:00.05 sh + 2749 ?? 0:13.94 dlpagent + 2750 ?? 0:00.56 icdd + 2751 ?? 0:28.43 GlobalProtect + 2752 ?? 0:09.10 Alertus Desktop + 2753 ?? 1:49.11 AvidLink + 2754 ?? 0:02.10 askpermissiond + 2757 ?? 0:15.19 AGMService + 2758 ?? 0:00.16 AirPlayUIAgent + 2763 ?? 0:00.05 bluetoothuserd + 2765 ?? 0:01.98 TextInputMenuAgent + 2766 ?? 0:00.70 Amazon Music Helper + 2767 ?? 5:52.63 Stream Deck + 2774 ?? 0:01.09 NIHardwareAgent + 2786 ?? 0:00.06 com.apple.audio.SandboxHelper + 2791 ?? 13:22.95 Time Out + 2796 ?? 0:00.02 PlugInLibraryService + 2801 ?? 0:00.02 taskgated + 2811 ?? 0:07.25 Microsoft Edge Helper + 2813 ?? 0:00.15 VTEncoderXPCService + 2814 ?? 0:43.47 Microsoft Edge Helper (Renderer) + 2818 ?? 0:00.06 com.apple.audio.SandboxHelper + 2856 ?? 140:06.94 Microsoft Teams Helper (Renderer) + 2857 ?? 0:00.02 CrashHandler + 2885 ?? 0:00.78 nsattributedstringagent + 2922 ?? 2:10.28 mysqld + 2931 ?? 9:10.75 Microsoft Teams Helper (Renderer) + 2943 ?? 0:09.94 Microsoft Edge Helper (Renderer) + 2958 ?? 0:48.01 AdobeIPCBroker + 2982 ?? 0:02.37 tipsd + 3041 ?? 0:58.20 Adobe Desktop Service + 3044 ?? 0:01.84 QtWebEngineProcess + 3053 ?? 0:00.02 CrashHandler + 3059 ?? 0:53.19 Adobe Crash Handler + 3068 ?? 0:00.74 vcxpc + 3070 ?? 0:00.16 VTDecoderXPCService + 3072 ?? 0:15.47 Creative Cloud Helper + 3073 ?? 0:17.59 QtWebEngineProcess + 3074 ?? 0:00.16 VTEncoderXPCService + 3075 ?? 0:00.62 QtWebEngineProcess + 3089 ?? 0:00.02 CrashHandler + 3093 ?? 0:52.85 Adobe Crash Handler + 3103 ?? 0:14.45 node + 3105 ?? 0:00.02 ChromaCamKitAssistant + 3119 ?? 0:01.00 Plugin + 3120 ?? 0:01.46 ESDDiscord + 3121 ?? 0:00.50 QtWebEngineProcess + 3122 ?? 0:18.80 QtWebEngineProcess + 3123 ?? 0:10.04 com.nicollasr.streamdeckvsc + 3125 ?? 0:00.02 TwitchStudioStreamDeck + 3126 ?? 0:57.40 se.trevligaspel.midi + 3127 ?? 0:00.52 QtWebEngineProcess + 3136 ?? 0:00.93 QtWebEngineProcess + 3142 ?? 0:01.65 QtWebEngineProcess + 3143 ?? 0:01.87 QtWebEngineProcess + 3144 ?? 0:02.14 QtWebEngineProcess + 3145 ?? 0:01.66 QtWebEngineProcess + 3149 ?? 0:11.67 Creative Cloud Helper + 3152 ?? 0:00.02 CrashHandler + 3158 ?? 0:53.06 Adobe Crash Handler + 3161 ?? 0:00.19 IDSBlastDoorService + 3162 ?? 0:00.14 BTLEServerAgent + 3172 ?? 1:53.09 Core Sync + 3187 ?? 0:00.19 com.adobe.acc.installer.v2 + 3199 ?? 0:00.11 MessagesBlastDoorService + 3219 ?? 0:00.36 IMTranscoderAgent + 3220 ?? 0:00.27 MessagesBlastDoorService + 3225 ?? 0:00.44 QtWebEngineProcess + 3231 ?? 0:00.33 Adobe Installer + 3238 ?? 0:38.31 MIDIServer + 3252 ?? 0:00.01 PlugInLibraryService + 3290 ?? 0:00.03 loginitemregisterd + 3417 ?? 0:00.08 check_afp + 3463 ?? 0:01.21 NIHostIntegrationAgent + 3474 ?? 0:00.01 PlugInLibraryService + 3811 ?? 0:00.01 PlugInLibraryService + 3817 ?? 0:00.04 com.apple.audio.SandboxHelper + 3842 ?? 0:03.77 VTDecoderXPCService + 3892 ?? 0:04.37 com.apple.WebKit.WebContent + 4064 ?? 0:03.52 newsd + 4299 ?? 0:00.01 ssh-agent + 4792 ?? 0:00.26 MTLCompilerService + 5189 ?? 4:26.24 wdavdaemon_unprivileged + 5231 ?? 1:20.97 Adobe_CCXProcess.node + 6661 ?? 0:00.15 com.apple.iCloudHelper + 6847 ?? 0:00.08 mdworker_shared + 6901 ?? 0:00.09 Google Chrome Helper (Renderer) + 6907 ?? 0:00.01 livefileproviderd + 6910 ?? 0:00.04 mdworker_shared + 6911 ?? 0:00.08 Microsoft Teams Helper (Renderer) + 6919 ?? 0:00.33 weatherd + 6965 ?? 0:04.58 PasswordBreachAgent + 7051 ?? 0:00.08 CategoriesService + 7154 ?? 21:40.07 Google Chrome + 7158 ?? 0:00.05 chrome_crashpad_handler + 7168 ?? 17:22.59 Google Chrome Helper (GPU) + 7169 ?? 4:07.80 Google Chrome Helper + 7172 ?? 0:09.23 Google Chrome Helper + 7179 ?? 0:32.81 VTDecoderXPCService + 7276 ?? 1:05.98 Google Chrome Helper + 7277 ?? 0:00.10 VTEncoderXPCService + 7278 ?? 0:00.05 com.apple.audio.SandboxHelper + 8037 ?? 0:06.03 com.apple.WebKit.WebContent + 8154 ?? 0:00.03 memoryanalyticsd + 8587 ?? 0:22.49 PerfPowerServices + 9855 ?? 0:00.95 Google Chrome Helper (Renderer) + 9860 ?? 2:20.71 Google Chrome Helper (Renderer) +11391 ?? 0:13.75 Google Chrome Helper (Renderer) +11392 ?? 1:13.21 Google Chrome Helper (Renderer) +12262 ?? 0:05.35 Google Chrome Helper (Renderer) +12299 ?? 0:01.03 Google Chrome Helper (Renderer) +12391 ?? 0:01.56 DockHelper +12517 ?? 1:32.66 Discord +12519 ?? 0:00.06 chrome_crashpad_handler +12520 ?? 11:07.90 Discord Helper (GPU) +12521 ?? 0:08.02 Discord Helper +12522 ?? 0:00.10 VTDecoderXPCService +12524 ?? 0:00.09 VTEncoderXPCService +12525 ?? 55:33.27 Discord Helper (Renderer) +12538 ?? 0:01.33 Discord Helper +12559 ?? 0:00.03 com.apple.audio.SandboxHelper +12780 ?? 0:00.05 MTLCompilerService +13091 ?? 0:46.04 VTDecoderXPCService +14791 ?? 0:01.53 Microsoft Edge Helper (Renderer) +15236 ?? 0:00.04 com.apple.audio.SandboxHelper +15237 ?? 0:00.17 printtool +15249 ?? 0:05.11 com.apple.SafariPlatformSupport.Helper +15257 ?? 0:00.03 com.apple.ctkpcscd +16834 ?? 0:01.61 package_script_service +16956 ?? 0:00.25 appleaccountd +19881 ?? 0:00.81 LookupViewService +19927 ?? 0:02.32 photoanalysisd +34545 ?? 3:53.79 mds +34546 ?? 0:00.01 PlugInLibraryService +34547 ?? 7:26.80 mds_stores +34910 ?? 0:16.03 mdworker +35665 ?? 0:01.20 mdworker +35956 ?? 0:03.20 Google Chrome Helper (Renderer) +36179 ?? 0:04.89 Google Chrome Helper (Renderer) +36835 ?? 0:00.01 PlugInLibraryService +36858 ?? 0:00.06 DiskUnmountWatcher +36892 ?? 0:00.12 MTLCompilerService +37656 ?? 0:00.03 com.apple.audio.SandboxHelper +38408 ?? 0:01.62 SafariBookmarksSyncAgent +38426 ?? 0:09.63 backgroundassets.user +38451 ?? 0:00.38 proactiveeventtrackerd +43617 ?? 0:00.51 rcd +45219 ?? 0:19.25 MacVim +46487 ?? 0:01.06 QuickLookUIService +46519 ?? 0:00.01 com.apple.tonelibraryd +47161 ?? 3:09.65 Google Chrome Helper (Renderer) +48190 ?? 0:12.88 Docker +48191 ?? 4:00.51 com.docker.backend +48197 ?? 0:02.95 com.docker.backend +48228 ?? 0:37.31 Docker Desktop +48244 ?? 0:18.96 com.docker.vpnkit +48245 ?? 0:07.16 docker +48247 ?? 0:05.61 vpnkit-bridge +48248 ?? 0:02.05 com.docker.driver.amd64-linux +48249 ?? 0:03.66 com.docker.extensions +48250 ?? 0:01.04 com.docker.dev-envs +48251 ?? 0:00.00 +48267 ?? 0:01.16 com.docker.virtualization +48273 ?? 44:33.09 com.apple.Virtualization.VirtualMachine +48276 ?? 0:02.62 Docker Desktop Helper (GPU) +48278 ?? 0:00.09 VTDecoderXPCService +48279 ?? 0:00.01 chrome_crashpad_handler +48280 ?? 0:00.21 Docker Desktop Helper +48282 ?? 102:20.33 Docker Desktop Helper (Renderer) +54642 ?? 0:00.39 ExternalQuickLookSatellite-x86_64 +56167 ?? 0:00.03 com.apple.audio.SandboxHelper +56184 ?? 0:01.51 CallHistorySyncHelper +58119 ?? 0:09.07 Google Chrome Helper (Renderer) +58680 ?? 1:15.18 Google Chrome Helper (Renderer) +58795 ?? 0:00.12 dprivacyd +60829 ?? 0:00.02 XProtect +60830 ?? 0:02.14 XProtectPluginService +60834 ?? 0:00.02 XProtect +60835 ?? 0:01.99 XProtectPluginService +61051 ?? 0:00.21 MobileSMSSpotlightImporterCatalyst +61052 ?? 0:00.56 com.apple.photos.ImageConversionService +61053 ?? 0:00.59 MessagesBlastDoorService +62406 ?? 0:00.38 OSDUIHelper +69998 ?? 0:00.06 IMAutomaticHistoryDeletionAgent +71756 ?? 5:47.48 Google Chrome Helper (Renderer) +71932 ?? 0:00.40 Google Chrome Helper (Renderer) +71934 ?? 0:09.02 Google Chrome Helper (Renderer) +71935 ?? 0:09.62 Google Chrome Helper (Renderer) +71936 ?? 2:32.75 Google Chrome Helper (Renderer) +71945 ?? 0:30.75 Google Chrome Helper (Renderer) +71947 ?? 0:03.10 Google Chrome Helper (Renderer) +71948 ?? 0:03.27 Google Chrome Helper (Renderer) +71949 ?? 0:00.37 Google Chrome Helper (Renderer) +71950 ?? 0:03.83 Google Chrome Helper (Renderer) +71952 ?? 0:02.99 Google Chrome Helper (Renderer) +71954 ?? 0:03.32 Google Chrome Helper (Renderer) +71955 ?? 0:03.89 Google Chrome Helper (Renderer) +71956 ?? 0:00.35 Google Chrome Helper (Renderer) +71957 ?? 0:04.67 Google Chrome Helper (Renderer) +71958 ?? 0:04.04 Google Chrome Helper (Renderer) +71959 ?? 0:00.36 Google Chrome Helper (Renderer) +71960 ?? 0:02.95 Google Chrome Helper (Renderer) +71968 ?? 0:03.44 Google Chrome Helper (Renderer) +71969 ?? 1:29.94 Google Chrome Helper (Renderer) +71970 ?? 0:00.97 Google Chrome Helper (Renderer) +72680 ?? 1:46.97 bluetoothd +72703 ?? 0:00.01 IOUserBluetoothSerialDriver +73627 ?? 0:12.27 Google Chrome Helper (Renderer) +75548 ?? 0:03.74 knowledgeconstructiond +76900 ?? 0:01.81 Google Chrome Helper (Renderer) +78475 ?? 0:00.92 QtWebEngineProcess +78476 ?? 0:00.92 QtWebEngineProcess +82319 ?? 0:00.01 PlugInLibraryService +84170 ?? 0:00.03 CalendarWidgetExtension +87412 ?? 0:00.02 griddatad +87439 ?? 0:00.03 devicecheckd +87490 ?? 0:00.10 EscrowSecurityAlert +87536 ?? 0:00.01 periodic-wrapper +87692 ?? 0:00.15 applessdstatistics +87749 ?? 0:00.03 sysdiagnose +87806 ?? 0:00.05 proactived +90659 ?? 0:00.33 nbagent +90662 ?? 0:00.03 nbstated +90884 ?? 0:00.68 contactsdonationagent +92805 ?? 0:00.01 chrome_crashpad_handler +94130 ?? 0:53.23 Electron +94134 ?? 0:00.01 chrome_crashpad_handler +94135 ?? 3:09.45 Code Helper (GPU) +94136 ?? 0:00.20 Code Helper +94137 ?? 0:00.10 VTDecoderXPCService +94138 ?? 5:26.03 Code Helper (Renderer) +94152 ?? 0:16.74 Code Helper (Renderer) +94153 ?? 1:44.58 Code Helper (Plugin) +94154 ?? 0:13.43 Code Helper (Renderer) +94163 ?? 0:00.60 Code Helper (Renderer) +94191 ?? 0:35.64 Code Helper (Plugin) +94227 ?? 2:06.71 dotnet +94286 ?? 0:00.50 Code Helper (Plugin) +97977 ?? 4:53.90 Google Chrome Helper (Renderer) +98046 ?? 0:02.69 Google Chrome Helper (Renderer) +98053 ?? 0:22.99 Google Chrome Helper (Renderer) +98054 ?? 0:05.17 Google Chrome Helper (Renderer) +98058 ?? 0:02.85 Google Chrome Helper (Renderer) +98059 ?? 0:02.85 Google Chrome Helper (Renderer) +98060 ?? 0:02.74 Google Chrome Helper (Renderer) +98061 ?? 0:03.55 Google Chrome Helper (Renderer) +98062 ?? 0:02.95 Google Chrome Helper (Renderer) +98067 ?? 0:02.95 Google Chrome Helper (Renderer) +98076 ?? 0:02.66 Google Chrome Helper (Renderer) +98080 ?? 0:02.82 Google Chrome Helper (Renderer) +98366 ?? 0:04.48 Google Chrome Helper (Renderer) + 2587 ttys000 0:00.03 login + 2596 ttys000 4:07.88 pwsh + 5350 ttys000 0:11.76 pwsh + 6924 ttys000 0:00.01 ps + 2597 ttys001 0:00.02 login + 2601 ttys001 0:48.31 pwsh + 2661 ttys002 0:27.98 pwsh + 2669 ttys003 0:27.37 pwsh + 2674 ttys004 0:27.75 pwsh + 2676 ttys005 0:27.57 pwsh +94197 ttys006 1:07.57 pwsh +94200 ttys007 0:05.13 pwsh diff --git a/test/assets/tasklist.01.txt b/test/assets/tasklist.01.txt new file mode 100644 index 0000000..96ad5a9 --- /dev/null +++ b/test/assets/tasklist.01.txt @@ -0,0 +1,48 @@ + +Image Name PID Session Name Session# Mem Usage +========================= ======== ================ =========== ============ +System Idle Process 0 Services 0 8 K +System 4 Services 0 8,240 K +Secure System 104 Services 0 73,736 K +Registry 172 Services 0 169,772 K +smss.exe 800 Services 0 1,228 K +csrss.exe 944 Services 0 4,984 K +svchost.exe 2380 Services 0 9,032 K +svchost.exe 3584 Services 0 9,668 K +svchost.exe 3808 Services 0 8,132 K +svchost.exe 3892 Services 0 7,812 K +spoolsv.exe 4000 Services 0 26,872 K +svchost.exe 3572 Services 0 13,732 K +vmms.exe 2956 Services 0 84,248 K +dfsrs.exe 4360 Services 0 114,964 K +ismserv.exe 4368 Services 0 4,920 K +ssh-agent.exe 4376 Services 0 3,504 K +TCPSVCS.EXE 4384 Services 0 2,960 K +TFSJobAgent.exe 4392 Services 0 118,204 K +sqlwriter.exe 4400 Services 0 21,088 K +sshd.exe 4408 Services 0 5,328 K +Microsoft.ActiveDirectory 4416 Services 0 46,780 K +inetinfo.exe 4504 Services 0 30,960 K +smartscreen.exe 6248 RDP-Tcp#33 2 29,940 K +svchost.exe 10088 Services 0 9,840 K +svchost.exe 9740 Services 0 19,360 K +svchost.exe 2100 Services 0 10,784 K +SecurityHealthService.exe 3276 Services 0 12,824 K +mmc.exe 9760 RDP-Tcp#33 2 62,316 K +pwsh.exe 8660 RDP-Tcp#33 2 112,700 K +conhost.exe 8060 RDP-Tcp#33 2 23,048 K +WmiPrvSE.exe 9372 Services 0 10,928 K +WmiPrvSE.exe 8084 Services 0 43,156 K +vmconnect.exe 6352 RDP-Tcp#33 2 242,068 K +vmwp.exe 9444 Services 0 48,084 K +powershell.exe 11132 RDP-Tcp#33 2 177,552 K +conhost.exe 2744 RDP-Tcp#33 2 28,044 K +powershell.exe 4592 RDP-Tcp#33 2 127,172 K +conhost.exe 11316 RDP-Tcp#33 2 8,440 K +svchost.exe 8104 Services 0 8,016 K +MsMpEng.exe 10232 Services 0 247,404 K +NisSrv.exe 11852 Services 0 11,500 K +dllhost.exe 11552 RDP-Tcp#33 2 12,572 K +TrustedInstaller.exe 4652 Services 0 7,276 K +TiWorker.exe 9996 Services 0 8,992 K +tasklist.exe 10660 RDP-Tcp#33 2 7,976 K diff --git a/test/assets/tasklist.02.txt b/test/assets/tasklist.02.txt new file mode 100644 index 0000000..03fb124 --- /dev/null +++ b/test/assets/tasklist.02.txt @@ -0,0 +1,41 @@ + +Image Name PID Session Name Session# Mem Usage +========================= ======== ================ =========== ============ +System Idle Process 0 Services 0 8 K +System 4 Services 0 8,240 K +Secure System 104 Services 0 73,736 K +Registry 172 Services 0 169,772 K +smss.exe 800 Services 0 1,228 K +csrss.exe 944 Services 0 4,984 K +csrss.exe 1020 Console 1 3,948 K +wininit.exe 128 Services 0 5,296 K +winlogon.exe 876 Console 1 7,924 K +services.exe 948 Services 0 18,948 K +LsaIso.exe 1044 Services 0 2,404 K +lsass.exe 1056 Services 0 197,156 K +svchost.exe 1340 Services 0 2,932 K +svchost.exe 1364 Services 0 24,896 K +svchost.exe 1412 Services 0 18,576 K +svchost.exe 1456 Services 0 12,284 K +LogonUI.exe 1536 Console 1 40,880 K +dwm.exe 1544 Console 1 32,964 K +svchost.exe 1568 Services 0 144,208 K +svchost.exe 1600 Services 0 9,444 K +mmc.exe 9760 RDP-Tcp#33 2 62,316 K +pwsh.exe 8660 RDP-Tcp#33 2 112,700 K +conhost.exe 8060 RDP-Tcp#33 2 23,048 K +WmiPrvSE.exe 9372 Services 0 10,928 K +WmiPrvSE.exe 8084 Services 0 43,156 K +vmconnect.exe 6352 RDP-Tcp#33 2 242,068 K +vmwp.exe 9444 Services 0 48,084 K +powershell.exe 11132 RDP-Tcp#33 2 177,552 K +conhost.exe 2744 RDP-Tcp#33 2 28,044 K +powershell.exe 4592 RDP-Tcp#33 2 127,172 K +conhost.exe 11316 RDP-Tcp#33 2 8,440 K +svchost.exe 8104 Services 0 8,016 K +MsMpEng.exe 10232 Services 0 247,404 K +NisSrv.exe 11852 Services 0 11,500 K +dllhost.exe 11552 RDP-Tcp#33 2 12,572 K +TrustedInstaller.exe 4652 Services 0 7,276 K +TiWorker.exe 9996 Services 0 8,992 K +tasklist.exe 10660 RDP-Tcp#33 2 7,976 K diff --git a/test/assets/who.01.txt b/test/assets/who.01.txt new file mode 100644 index 0000000..728dfc9 --- /dev/null +++ b/test/assets/who.01.txt @@ -0,0 +1,6 @@ +reboot ~ Sep 14 10:10 00:04 1 +james console Sep 14 10:11 old 283 +james ttys000 Sep 26 13:12 00:09 50821 term=0 exit=0 +james ttys001 Oct 12 16:58 . 73518 +james ttys002 Oct 5 16:36 . 90609 term=0 exit=0 +james ttys006 Oct 11 15:41 . 25351 term=0 exit=0 diff --git a/test/assets/who.02.txt b/test/assets/who.02.txt new file mode 100644 index 0000000..aa86626 --- /dev/null +++ b/test/assets/who.02.txt @@ -0,0 +1,4 @@ +NAME LINE TIME FROM +james console Feb 14 09:35 +james ttys000 Feb 14 09:45 +james ttys001 Feb 14 09:45