Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add button with Clear Terminal next to Trash Can or similar place #1651

Closed
PrzemyslawKlys opened this issue Dec 12, 2018 · 13 comments
Closed

Comments

@PrzemyslawKlys
Copy link
Contributor

PrzemyslawKlys commented Dec 12, 2018

Summary of the new feature

As you know currently using CLS/Clear-Host doesn't bring any joy due to xtermjs implementation.

One way to workaround this is to use Terminal: Clear from VSCode commands

image

Would be cool if you would be able to add this in a button form somewhere in there (could be largest button possible if you ask me)

image

Or possibly bind Clear-Host / CLS with that command magically making it work.

@rjmholt
Copy link
Contributor

rjmholt commented Dec 12, 2018

This sounds like something VSCode would need to add

@SydneyhSmith
Copy link
Collaborator

@PrzemyslawKlys this seems like a potentially good feature enhancement but it will have to come from VSCode, can you open an issue there?

@rjmholt
Copy link
Contributor

rjmholt commented Dec 13, 2018

If an API were made available for this, it might be possible to rebind Clear-Host in the integrated console, although arguably xterm.js should have this work without us touching anything (i.e. it transparently emulates a console host) and it's worth looking through the issues there.

The current behaviour just scrolls to the bottom right? Is there a reason for wanting to erase the terminal, rather than just having things scroll off screen? I ask just because it might be significant effort for a small value add.

@PrzemyslawKlys
Copy link
Contributor Author

There are 2 problems with the current implementation:

  • You don't know where one run of the script ends and one starts - consider an output from 1 run as below. It outputs on 3+ pages. If I have errors I usually have to scroll up and I usually end up not knowing whether it's still an old run, new run or anything else. They mix. And if they don't have distinguish names I'm clueless. With Clear-Host I should be sure I only get last run output. I sometimes add Write-Color -Text 'This IS MY START' -Color Blue just to make sure I debug only problems from last run.

[14.12.2018 08:41:37][Info] Testing for configuration consistency. This is to make sure the script can be safely executed.
[14.12.2018 08:41:37][Success] Parameter ShowTime in configuration of LoggerParameters exists
[14.12.2018 08:41:37][Success] Parameter LogsDir in configuration of LoggerParameters exists
[14.12.2018 08:41:37][Success] Parameter TimeFormat in configuration of LoggerParameters exists
[14.12.2018 08:41:37][Success] Parameter EmailFrom in configuration of EmailParameters exists
[14.12.2018 08:41:37][Success] Parameter EmailTo in configuration of EmailParameters exists
[14.12.2018 08:41:37][Success] Parameter EmailCC in configuration of EmailParameters exists
[14.12.2018 08:41:37][Success] Parameter EmailBCC in configuration of EmailParameters exists
[14.12.2018 08:41:37][Success] Parameter EmailServer in configuration of EmailParameters exists
[14.12.2018 08:41:37][Success] Parameter EmailServerPassword in configuration of EmailParameters exists
[14.12.2018 08:41:37][Success] Parameter EmailServerPort in configuration of EmailParameters exists
[14.12.2018 08:41:37][Success] Parameter EmailServerLogin in configuration of EmailParameters exists
[14.12.2018 08:41:37][Success] Parameter EmailServerEnableSSL in configuration of EmailParameters exists
[14.12.2018 08:41:37][Success] Parameter EmailEncoding in configuration of EmailParameters exists
[14.12.2018 08:41:37][Success] Parameter EmailSubject in configuration of EmailParameters exists
[14.12.2018 08:41:37][Success] Parameter EmailPriority in configuration of EmailParameters exists
[14.12.2018 08:41:37][Success] Parameter EmailReplyTo in configuration of EmailParameters exists
[14.12.2018 08:41:37][Success] Parameter CompanyBranding in configuration of FormattingParameters exists
[14.12.2018 08:41:37][Success] Parameter Logo in configuration of FormattingParameters.CompanyBranding exists
[14.12.2018 08:41:37][Success] Parameter Inline in configuration of FormattingParameters.CompanyBranding exists
[14.12.2018 08:41:37][Success] Parameter Width in configuration of FormattingParameters.CompanyBranding exists
[14.12.2018 08:41:37][Success] Parameter Height in configuration of FormattingParameters.CompanyBranding exists
[14.12.2018 08:41:37][Success] Parameter Link in configuration of FormattingParameters.CompanyBranding exists
[14.12.2018 08:41:37][Success] Parameter FontFamily in configuration of FormattingParameters exists
[14.12.2018 08:41:37][Success] Parameter FontSize in configuration of FormattingParameters exists
[14.12.2018 08:41:37][Success] Parameter FontHeadingFamily in configuration of FormattingParameters exists
[14.12.2018 08:41:37][Success] Parameter FontHeadingSize in configuration of FormattingParameters exists
[14.12.2018 08:41:37][Success] Parameter JustTestPrerequisite in configuration of ReportOptions exists
[14.12.2018 08:41:37][Success] Parameter AsExcel in configuration of ReportOptions exists
[14.12.2018 08:41:37][Success] Parameter AsCSV in configuration of ReportOptions exists
[14.12.2018 08:41:37][Success] Parameter AsHTML in configuration of ReportOptions exists
[14.12.2018 08:41:37][Success] Parameter SendMail in configuration of ReportOptions exists
[14.12.2018 08:41:37][Success] Parameter OpenAsFile in configuration of ReportOptions exists
[14.12.2018 08:41:37][Success] Parameter KeepReports in configuration of ReportOptions exists
[14.12.2018 08:41:37][Success] Parameter FilePattern in configuration of ReportOptions exists
[14.12.2018 08:41:37][Success] Parameter FilePatternDateFormat in configuration of ReportOptions exists
[14.12.2018 08:41:37][Success] Parameter RemoveDuplicates in configuration of ReportOptions exists
[14.12.2018 08:41:37][Success] Parameter Debug in configuration of ReportOptions exists
[14.12.2018 08:41:37][Success] Parameter DisplayTemplateHTML in configuration of ReportOptions.Debug exists
[14.12.2018 08:41:37][Success] Parameter Verbose in configuration of ReportOptions.Debug exists
[14.12.2018 08:41:37][Success] Parameter Use in configuration of ReportOptions.AsSql exists
[14.12.2018 08:41:37][Success] Parameter SqlServer in configuration of ReportOptions.AsSql exists
[14.12.2018 08:41:37][Success] Parameter SqlDatabase in configuration of ReportOptions.AsSql exists
[14.12.2018 08:41:37][Success] Parameter SqlTable in configuration of ReportOptions.AsSql exists
[14.12.2018 08:41:37][Success] Parameter SqlTableCreate in configuration of ReportOptions.AsSql exists
[14.12.2018 08:41:37][Success] Parameter SqlTableAlterIfNeeded in configuration of ReportOptions.AsSql exists
[14.12.2018 08:41:37][Success] Parameter SqlCheckBeforeInsert in configuration of ReportOptions.AsSql exists
[14.12.2018 08:41:37][Success] Parameter ReportsAD in configuration of ReportDefinitions exists
[14.12.2018 08:41:37][Success] Parameter Servers in configuration of ReportDefinitions.ReportsAD exists
[14.12.2018 08:41:37][Success] Parameter UseForwarders in configuration of ReportDefinitions.ReportsAD.Servers exists
[14.12.2018 08:41:37][Success] Parameter ForwardServer in configuration of ReportDefinitions.ReportsAD.Servers exists
[14.12.2018 08:41:37][Success] Parameter ForwardEventLog in configuration of ReportDefinitions.ReportsAD.Servers exists
[14.12.2018 08:41:37][Success] Parameter UseDirectScan in configuration of ReportDefinitions.ReportsAD.Servers exists
[14.12.2018 08:41:37][Success] Parameter Automatic in configuration of ReportDefinitions.ReportsAD.Servers exists
[14.12.2018 08:41:37][Success] Parameter OnlyPDC in configuration of ReportDefinitions.ReportsAD.Servers exists
[14.12.2018 08:41:37][Success] Parameter DC in configuration of ReportDefinitions.ReportsAD.Servers exists
[14.12.2018 08:41:37][Success] Parameter Directories in configuration of ReportDefinitions.ReportsAD.ArchiveProcessing exists
[14.12.2018 08:41:37][Success] Parameter Files in configuration of ReportDefinitions.ReportsAD.ArchiveProcessing exists
[14.12.2018 08:41:37][Success] Parameter EventBased in configuration of ReportDefinitions.ReportsAD exists
[14.12.2018 08:41:37][Success] Parameter UserChanges in configuration of ReportDefinitions.ReportsAD.EventBased exists
[14.12.2018 08:41:37][Success] Parameter Enabled in configuration of ReportDefinitions.ReportsAD.EventBased.UserChanges exists
[14.12.2018 08:41:37][Success] Parameter Events in configuration of ReportDefinitions.ReportsAD.EventBased.UserChanges exists
[14.12.2018 08:41:37][Success] Parameter LogName in configuration of ReportDefinitions.ReportsAD.EventBased.UserChanges exists
[14.12.2018 08:41:37][Success] Parameter IgnoreWords in configuration of ReportDefinitions.ReportsAD.EventBased.UserChanges exists
[14.12.2018 08:41:37][Success] Parameter Custom in configuration of ReportDefinitions.ReportsAD exists
[14.12.2018 08:41:37][Success] Parameter EventLogSize in configuration of ReportDefinitions.ReportsAD.Custom exists
[14.12.2018 08:41:37][Success] Parameter Enabled in configuration of ReportDefinitions.ReportsAD.Custom.EventLogSize exists
[14.12.2018 08:41:38][Success] Parameter Logs in configuration of ReportDefinitions.ReportsAD.Custom.EventLogSize exists
[14.12.2018 08:41:38][Success] Parameter SortBy in configuration of ReportDefinitions.ReportsAD.Custom.EventLogSize exists
[14.12.2018 08:41:38][Success] Parameter ServersData in configuration of ReportDefinitions.ReportsAD.Custom exists
[14.12.2018 08:41:38][Success] Parameter Enabled in configuration of ReportDefinitions.ReportsAD.Custom.ServersData exists
[14.12.2018 08:41:38][Success] Parameter FilesData in configuration of ReportDefinitions.ReportsAD.Custom exists
[14.12.2018 08:41:38][Success] Parameter Enabled in configuration of ReportDefinitions.ReportsAD.Custom.FilesData exists
[14.12.2018 08:41:38][Success] Parameter PastHour in configuration of ReportTimes exists
[14.12.2018 08:41:38][Success] Parameter Enabled in configuration of ReportTimes.PastHour exists and correct
[14.12.2018 08:41:38][Success] Parameter CurrentHour in configuration of ReportTimes exists
[14.12.2018 08:41:38][Success] Parameter Enabled in configuration of ReportTimes.CurrentHour exists and correct
[14.12.2018 08:41:38][Success] Parameter PastDay in configuration of ReportTimes exists
[14.12.2018 08:41:38][Success] Parameter Enabled in configuration of ReportTimes.PastDay exists and correct
[14.12.2018 08:41:38][Success] Parameter CurrentDay in configuration of ReportTimes exists
[14.12.2018 08:41:38][Success] Parameter Enabled in configuration of ReportTimes.CurrentDay exists and correct
[14.12.2018 08:41:38][Success] Parameter OnDay in configuration of ReportTimes exists
[14.12.2018 08:41:38][Success] Parameter Enabled in configuration of ReportTimes.OnDay exists
[14.12.2018 08:41:38][Success] Parameter Days in configuration of ReportTimes.OnDay exists
[14.12.2018 08:41:38][Success] Parameter PastMonth in configuration of ReportTimes exists
[14.12.2018 08:41:38][Success] Parameter Enabled in configuration of ReportTimes.PastMonth exists
[14.12.2018 08:41:38][Success] Parameter Force in configuration of ReportTimes.PastMonth exists
[14.12.2018 08:41:38][Success] Parameter CurrentMonth in configuration of ReportTimes exists
[14.12.2018 08:41:38][Success] Parameter PastQuarter in configuration of ReportTimes exists
[14.12.2018 08:41:38][Success] Parameter Enabled in configuration of ReportTimes.PastQuarter exists
[14.12.2018 08:41:38][Success] Parameter Force in configuration of ReportTimes.PastQuarter exists
[14.12.2018 08:41:38][Success] Parameter CurrentQuarter in configuration of ReportTimes exists
[14.12.2018 08:41:38][Success] Parameter CurrentDayMinusDayX in configuration of ReportTimes exists
[14.12.2018 08:41:38][Success] Parameter Enabled in configuration of ReportTimes.CurrentDayMinusDayX exists
[14.12.2018 08:41:38][Success] Parameter Days in configuration of ReportTimes.CurrentDayMinusDayX exists
[14.12.2018 08:41:38][Success] Parameter CurrentDayMinuxDaysX in configuration of ReportTimes exists
[14.12.2018 08:41:38][Success] Parameter Enabled in configuration of ReportTimes.CurrentDayMinuxDaysX exists
[14.12.2018 08:41:38][Success] Parameter Days in configuration of ReportTimes.CurrentDayMinuxDaysX exists
[14.12.2018 08:41:38][Success] Parameter CustomDate in configuration of ReportTimes exists
[14.12.2018 08:41:38][Success] Parameter Enabled in configuration of ReportTimes.CustomDate exists
[14.12.2018 08:41:38][Success] Parameter DateFrom in configuration of ReportTimes.CustomDate exists
[14.12.2018 08:41:38][Success] Parameter DateTo in configuration of ReportTimes.CustomDate exists
[14.12.2018 08:41:38][Success] Parameter Everything in configuration of ReportTimes exists
[14.12.2018 08:41:38][Success] Parameter Enabled in configuration of ReportTimes.Everything exists and correct
[14.12.2018 08:41:38][Success] Parameter AsExcel in configuration of ReportOptions exists
[14.12.2018 08:41:38][Success] Parameter AsCSV in configuration of ReportOptions exists
[14.12.2018 08:41:38][Success] Parameter AsHTML in configuration of ReportOptions exists
[14.12.2018 08:41:38][Success] Parameter SendMail in configuration of ReportOptions exists
[14.12.2018 08:41:38][Success] Parameter KeepReportsPath in configuration of ReportOptions exists
[14.12.2018 08:41:38][Success] Parameter FilePattern in configuration of ReportOptions exists
[14.12.2018 08:41:38][Success] Parameter FilePatternDateFormat in configuration of ReportOptions exists
[14.12.2018 08:41:38][Success] Parameter RemoveDuplicates in configuration of ReportOptions exists
[14.12.2018 08:41:38][Info] Testing for prerequisite availability
[14.12.2018 08:41:38][Success] PSEventViewer module imported
[14.12.2018 08:41:38][Success] PSWinReporting module imported
[14.12.2018 08:41:38][Success] PSWriteExcel module imported
[14.12.2018 08:41:47][Success] ActiveDirectory module imported
[14.12.2018 08:41:48][Info] Starting to build a report
[14.12.2018 08:41:48][Info] Processing report for dates from: 12/01/2018 00:00:00 to 12/31/2018 23:59:59
[14.12.2018 08:41:48][Info] Establishing servers list to process...
[14.12.2018 08:42:01][Error] Get-DC Error for domain ad.evotec.pl: Unable to contact the server. This may be because this server does not exist, it is currently down, or it does not have the Active Directory Web Services running.
[14.12.2018 08:42:01][Info] Preparing Security Events list to be processed
[14.12.2018 08:42:02][Info] Preparing System Events list to be processed
[14.12.2018 08:42:02][Info] Found security events to process: 4740, 4728, 4729, 4732, 4733, 4756, 4757, 4761, 4762, 4741, 4742, 1102, 1105, 4727, 4730, 4731, 4734, 4759, 4760, 4754, 4758, 4743, 4720, 4738, 4722, 4725, 4767, 4723, 4724, 4726
[14.12.2018 08:42:02][Info] Found system events to process: 104
[14.12.2018 08:42:02][Info] Preparing Forwarded Events on forwarding servers: EVO1
[14.12.2018 08:42:03][Info] Processing Security Events from directly scanned servers: AD2.ad.evotec.xyz, AD1.ad.evotec.xyz
[14.12.2018 08:42:05][Info] Processing System Events from directly scanned servers: AD2.ad.evotec.xyz, AD1.ad.evotec.xyz
[14.12.2018 08:42:05][Info] Processing Event Log Sizes on defined servers for warnings
[14.12.2018 08:42:05][Info] Processing Event Log Sizes on EVO1 for warnings
[14.12.2018 08:42:05][Info] Processing Event Log Sizes on AD2.ad.evotec.xyz, AD1.ad.evotec.xyz for warnings
[14.12.2018 08:42:06][Info] Verifying Warnings reported earlier
[14.12.2018 08:42:06][Warning] Security log on AD2.ad.evotec.xyz doesn't cover whole date range requested. Oldest event 12/03/2018 02:45:24 while requested 12/01/2018 00:00:00.
[14.12.2018 08:42:06][Warning] Security log on AD1.ad.evotec.xyz doesn't cover whole date range requested. Oldest event 12/13/2018 13:41:38 while requested 12/01/2018 00:00:00.
[14.12.2018 08:42:06][Warning] System log on AD1.ad.evotec.xyz doesn't cover whole date range requested. Oldest event 12/03/2018 17:20:48 while requested 12/01/2018
00:00:00.
[14.12.2018 08:42:06][Info] Removing Duplicates from all events. Current list contains 21 events
[14.12.2018 08:42:06][Info] Removed Duplicates Following 14 events will be analyzed further
[14.12.2018 08:42:06][Info] Running UserLockouts Report
[14.12.2018 08:42:06][Info] Events Processed: 0, EventsType: Security EventsID: 4740
[14.12.2018 08:42:06][Info] Ending UserLockouts Report - Elapsed time: 0 days, 0 hours, 0 minutes, 0 seconds, 104 milliseconds
[14.12.2018 08:42:06][Info] Running GroupMembershipChanges Report
[14.12.2018 08:42:06][Info] Events Processed: 0, EventsType: Security EventsID: 4728 4729 4732 4733 4756 4757 4761 4762
[14.12.2018 08:42:06][Info] Ending GroupMembershipChanges Report - Elapsed time: 0 days, 0 hours, 0 minutes, 0 seconds, 13 milliseconds
[14.12.2018 08:42:06][Info] Running ComputerCreatedChanged Report
[14.12.2018 08:42:06][Info] Events Processed: , EventsType: Security EventsID: 4741 4742
[14.12.2018 08:42:06][Info] Ending ComputerCreatedChanged Report - Elapsed time: 0 days, 0 hours, 0 minutes, 0 seconds, 99 milliseconds
[14.12.2018 08:42:06][Info] Running LogsClearedSecurity Report
[14.12.2018 08:42:06][Info] Events Processed: 3, EventsType: Security EventsID: 1102 1105
[14.12.2018 08:42:06][Info] Ending LogsClearedSecurity Report - Elapsed time: 0 days, 0 hours, 0 minutes, 0 seconds, 70 milliseconds
[14.12.2018 08:42:06][Info] Running GroupCreateDelete Report
[14.12.2018 08:42:06][Info] Events Processed: 0, EventsType: Security EventsID: 4727 4730 4731 4734 4759 4760 4754 4758
[14.12.2018 08:42:06][Info] Ending GroupCreateDelete Report - Elapsed time: 0 days, 0 hours, 0 minutes, 0 seconds, 10 milliseconds
[14.12.2018 08:42:06][Info] Running ComputerDeleted Report
[14.12.2018 08:42:06][Info] Events Processed: 0, EventsType: Security EventsID: 4743
[14.12.2018 08:42:06][Info] Ending ComputerDeleted Report - Elapsed time: 0 days, 0 hours, 0 minutes, 0 seconds, 11 milliseconds
[14.12.2018 08:42:06][Info] Running UserChanges Report
[14.12.2018 08:42:07][Info] Events Processed: 6, EventsType: Security EventsID: 4720 4738
[14.12.2018 08:42:07][Info] Ending UserChanges Report - Elapsed time: 0 days, 0 hours, 0 minutes, 0 seconds, 584 milliseconds
[14.12.2018 08:42:07][Info] Running UserStatus Report
[14.12.2018 08:42:07][Info] Events Processed: 4, EventsType: Security EventsID: 4722 4725 4767 4723 4724 4726
[14.12.2018 08:42:07][Info] Ending UserStatus Report - Elapsed time: 0 days, 0 hours, 0 minutes, 0 seconds, 301 milliseconds
[14.12.2018 08:42:07][Info] Running LogsClearedOther Report
[14.12.2018 08:42:07][Info] Events Processed: 0, EventsType: System EventsID: 104
[14.12.2018 08:42:07][Info] Ending LogsClearedOther Report - Elapsed time: 0 days, 0 hours, 0 minutes, 0 seconds, 13 milliseconds
[14.12.2018 08:42:07][Info] Running Event Log Size Report for ForwardedEvents log
[14.12.2018 08:42:07][Info] Ending Event Log Size Report for ForwardedEvents log
[14.12.2018 08:42:07][Info] Running Event Log Size Report for Security log
[14.12.2018 08:42:07][Info] Ending Event Log Size Report for Security log
[14.12.2018 08:42:07][Info] Running Event Log Size Report for Application log
[14.12.2018 08:42:07][Info] Ending Event Log Size Report for Application log
[14.12.2018 08:42:07][Info] Running Event Log Size Report for System log
[14.12.2018 08:42:07][Info] Ending Event Log Size Report for System log
[14.12.2018 08:42:07][Info] Prepare email head and body
[14.12.2018 08:42:07][Info] Prepare XLSX files with Events
[14.12.2018 08:42:10][Info] Prepare CSV files with Events
Export-ReportToCSV : Cannot process argument transformation on parameter 'ReportTable'. Cannot convert the "System.Object[]" value of type "System.Object[]" to type
 "System.Collections.IDictionary".
At C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\PSWinReporting\Private\Main\Start-Report.ps1:149 char:192
+ ...  -Extension "csv" -ReportName "ReportServers" -ReportTable $ServersAD
+                                                                ~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Export-ReportToCSV], ParameterBindingArgumentTransformationException
    + FullyQualifiedErrorId : ParameterArgumentTransformationError,Export-ReportToCSV

Export-ReportToCSV : Cannot process argument transformation on parameter 'ReportTable'. Cannot convert the "System.Object[]" value of type "System.Object[]" to type
 "System.Collections.IDictionary".
At C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\PSWinReporting\Private\Main\Start-Report.ps1:150 char:198
+ ... on "csv" -ReportName "ReportEventLogSize" -ReportTable $EventLogTable
+                                                            ~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Export-ReportToCSV], ParameterBindingArgumentTransformationException
    + FullyQualifiedErrorId : ParameterArgumentTransformationError,Export-ReportToCSV

Export-ReportToCSV : Cannot process argument transformation on parameter 'ReportTable'. Cannot convert the "@{Domain Controller=AD1.ad.evotec.xyz; Action=A computer
 account was changed.; Computer Affected=EVOTEC\AD2$; SamAccountName=; DisplayName=; UserPrincipalName=; Home Directory=; Home Path=; Script Path=; Profile Path=; U
ser Workstations=; Password Last Set=10.12.2018 23:10:27; Account Expires=; Primary Group Id=; Allowed To Delegate To=; Old Uac Value=; New Uac Value=; User Account
 Control=; User Parameters=; Sid History=; Who=NT AUTHORITY\ANONYMOUS LOGON; When=10.12.2018 23:10:27; Event ID=4742; Record ID=4519195; Gathered From=EVO1; Gathere
d LogName=ForwardedEvents}" value of type "Selected.System.Management.Automation.PSCustomObject" to type "System.Collections.IDictionary".
At C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\PSWinReporting\Private\Main\Start-Report.ps1:153 char:196
+ ... nsion "csv" -ReportName $ReportName -ReportTable $Results.$ReportName
+                                                      ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Export-ReportToCSV], ParameterBindingArgumentTransformationException
    + FullyQualifiedErrorId : ParameterArgumentTransformationError,Export-ReportToCSV

Export-ReportToCSV : Cannot process argument transformation on parameter 'ReportTable'. Cannot convert the "System.Object[]" value of type "System.Object[]" to type
 "System.Collections.IDictionary".
At C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\PSWinReporting\Private\Main\Start-Report.ps1:153 char:196
+ ... nsion "csv" -ReportName $ReportName -ReportTable $Results.$ReportName
+                                                      ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Export-ReportToCSV], ParameterBindingArgumentTransformationException
    + FullyQualifiedErrorId : ParameterArgumentTransformationError,Export-ReportToCSV

Export-ReportToCSV : Cannot process argument transformation on parameter 'ReportTable'. Cannot convert the "System.Object[]" value of type "System.Object[]" to type
 "System.Collections.IDictionary".
At C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\PSWinReporting\Private\Main\Start-Report.ps1:153 char:196
+ ... nsion "csv" -ReportName $ReportName -ReportTable $Results.$ReportName
+                                                      ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Export-ReportToCSV], ParameterBindingArgumentTransformationException
    + FullyQualifiedErrorId : ParameterArgumentTransformationError,Export-ReportToCSV

Export-ReportToCSV : Cannot process argument transformation on parameter 'ReportTable'. Cannot convert the "System.Object[]" value of type "System.Object[]" to type
 "System.Collections.IDictionary".
At C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\PSWinReporting\Private\Main\Start-Report.ps1:153 char:196
+ ... nsion "csv" -ReportName $ReportName -ReportTable $Results.$ReportName
+                                                      ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Export-ReportToCSV], ParameterBindingArgumentTransformationException
    + FullyQualifiedErrorId : ParameterArgumentTransformationError,Export-ReportToCSV

[14.12.2018 08:42:10][Info] Prepare Email replacements and formatting
[14.12.2018 08:42:10][Info] Preparing template - adding HTML <BR> tags...
[14.12.2018 08:42:10][Info] Preparing template - adding HTML B tag for status.
[14.12.2018 08:42:10][Info] Preparing template - adding HTML B tag for Domain Admins.
[14.12.2018 08:42:10][Info] Preparing template - adding HTML B tag for Enterprise Admins.
[14.12.2018 08:42:10][Info] Preparing template - adding HTML B tag for Schema Admins.
[14.12.2018 08:42:10][Info] Preparing template - adding HTML B tag for was cleared.
[14.12.2018 08:42:10][Info] Preparing template - adding HTML B tag for lockouts.
[14.12.2018 08:42:10][Info] Preparing template - adding HTML U tag for status.
[14.12.2018 08:42:10][Info] Preparing template - adding HTML Red tag for removed.
[14.12.2018 08:42:10][Info] Preparing template - adding HTML Red tag for deleted.
[14.12.2018 08:42:10][Info] Preparing template - adding HTML Red tag for locked out.
[14.12.2018 08:42:10][Info] Preparing template - adding HTML Red tag for lockouts.
[14.12.2018 08:42:10][Info] Preparing template - adding HTML Red tag for disabled.
[14.12.2018 08:42:10][Info] Preparing template - adding HTML Red tag for Domain Admins.
[14.12.2018 08:42:10][Info] Preparing template - adding HTML Red tag for was cleared.
[14.12.2018 08:42:10][Info] Preparing template - adding HTML Blue tag for changed.
[14.12.2018 08:42:10][Info] Preparing template - adding HTML Blue tag for changes.
[14.12.2018 08:42:10][Info] Preparing template - adding HTML Blue tag for change.
[14.12.2018 08:42:10][Info] Preparing template - adding HTML Blue tag for reset.
[14.12.2018 08:42:10][Info] Preparing template - adding HTML Green tag for added.
[14.12.2018 08:42:10][Info] Preparing template - adding HTML Green tag for enabled.
[14.12.2018 08:42:10][Info] Preparing template - adding HTML Green tag for unlocked.
[14.12.2018 08:42:10][Info] Preparing template - adding HTML Green tag for created.
[14.12.2018 08:42:10][Info] Saving report to file: C:\Support\Reports\ExportedEvents\Evotec-ADMonitoredEvents-2018-12-14-08_42_10.html
[14.12.2018 08:42:10][Info] Sending Logs Cleared Security to SQL at Local level
[14.12.2018 08:42:16][Info] MS SQL Output: IF NOT EXISTS ( SELECT 1 FROM  dbo.[EventsLogsClearedSecurity]  WHERE [RecordID] = '3121938' ) BEGIN INSERT INTO  dbo.[EventsLogsClearedSecurity] ( [DomainController],[Action],[BackupPath],[LogType],[Who],[When],[EventID],[RecordID],[GatheredFrom],[GatheredLogName],[AddedWhen],[AddedWho] ) VALUES ( 'AD2.ad.evotec.xyz','Event log automatic backup','C:\Windows\System32\Winevt\Logs\Archive-Security-2018-12-03-01-45-24-414.evtx','Security','Automatic Backup','2018-12-03 02:45:24','1105','3121938','EVO1','ForwardedEvents','2018-12-14 08:42:16','przemyslaw.klys' ) END
[14.12.2018 08:42:16][Info] MS SQL Output: IF NOT EXISTS ( SELECT 1 FROM  dbo.[EventsLogsClearedSecurity]  WHERE [RecordID] = '4369511' ) BEGIN INSERT INTO  dbo.[EventsLogsClearedSecurity] ( [DomainController],[Action],[BackupPath],[LogType],[Who],[When],[EventID],[RecordID],[GatheredFrom],[GatheredLogName],[AddedWhen],[AddedWho] ) VALUES ( 'AD1.ad.evotec.xyz','Event log automatic backup','C:\Windows\System32\Winevt\Logs\Archive-Security-2018-12-04-08-53-02-588.evtx','Security','Automatic Backup','2018-12-04 09:53:03','1105','4369511','EVO1','ForwardedEvents','2018-12-14 08:42:16','przemyslaw.klys' ) END
[14.12.2018 08:42:16][Info] MS SQL Output: IF NOT EXISTS ( SELECT 1 FROM  dbo.[EventsLogsClearedSecurity]  WHERE [RecordID] = '4563464' ) BEGIN INSERT INTO  dbo.[EventsLogsClearedSecurity] ( [DomainController],[Action],[BackupPath],[LogType],[Who],[When],[EventID],[RecordID],[GatheredFrom],[GatheredLogName],[AddedWhen],[AddedWho] ) VALUES ( 'AD1.ad.evotec.xyz','Event log automatic backup','C:\Windows\System32\Winevt\Logs\Archive-Security-2018-12-13-12-41-38-139.evtx','Security','Automatic Backup','2018-12-13 13:41:38','1105','4563464','AD1.ad.evotec.xyz','Security','2018-12-14 08:42:16','przemyslaw.klys' ) END
[14.12.2018 08:42:16][Info] Sending User Changes to SQL at Global level
[14.12.2018 08:42:17][Info] MS SQL Output: IF NOT EXISTS ( SELECT 1 FROM  dbo.[Events]  WHERE [EventRecordID] = '4516507' ) BEGIN INSERT INTO  dbo.[Events] ( [DomainController],[Action],[UserAffected],[SamAccountName],[UserPrincipalName],[HomeDirectory],[HomePath],[ScriptPath],[ProfilePath],[PasswordLastSet],[AccountExpires],[PrimaryGroupId],[AllowedToDelegateTo],[OldUacValue],[NewUacValue],[UserAccountControl],[UserParameters],[SidHistory],[EventWho],[EventWhen],[EventID],[EventRecordID],[GatheredFrom],[GatheredLogName],[EventAdded],[EventAddedWho] ) VALUES ( 'AD1.ad.evotec.xyz','A user account was changed.','EVOTEC\svcTaskScheduler',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'LOCKOUT, NORMAL_ACCOUNT','LOCKOUT, NORMAL_ACCOUNT','INTERDOMAIN_TRUST_ACCOUNT',NULL,NULL,'EVOTEC\Administrator','2018-12-10 20:43:41','4738','4516507','EVO1','ForwardedEvents','2018-12-14 08:42:16','przemyslaw.klys' ) END
[14.12.2018 08:42:17][Info] MS SQL Output: IF NOT EXISTS ( SELECT 1 FROM  dbo.[Events]  WHERE [EventRecordID] = '4516512' ) BEGIN INSERT INTO  dbo.[Events] ( [DomainController],[Action],[UserAffected],[SamAccountName],[UserPrincipalName],[HomeDirectory],[HomePath],[ScriptPath],[ProfilePath],[PasswordLastSet],[AccountExpires],[PrimaryGroupId],[AllowedToDelegateTo],[OldUacValue],[NewUacValue],[UserAccountControl],[UserParameters],[SidHistory],[EventWho],[EventWhen],[EventID],[EventRecordID],[GatheredFrom],[GatheredLogName],[EventAdded],[EventAddedWho] ) VALUES ( 'AD1.ad.evotec.xyz','A user account was changed.','EVOTEC\svcTaskScheduler',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'LOCKOUT, NORMAL_ACCOUNT','LOCKOUT, NORMAL_ACCOUNT','PASSWD_NOTREQD, INTERDOMAIN_TRUST_ACCOUNT',NULL,NULL,'EVOTEC\Administrator','2018-12-10 20:43:45','4738','4516512','EVO1','ForwardedEvents','2018-12-14 08:42:17','przemyslaw.klys' ) END
[14.12.2018 08:42:17][Info] MS SQL Output: IF NOT EXISTS ( SELECT 1 FROM  dbo.[Events]  WHERE [EventRecordID] = '4516514' ) BEGIN INSERT INTO  dbo.[Events] ( [DomainController],[Action],[UserAffected],[SamAccountName],[UserPrincipalName],[HomeDirectory],[HomePath],[ScriptPath],[ProfilePath],[PasswordLastSet],[AccountExpires],[PrimaryGroupId],[AllowedToDelegateTo],[OldUacValue],[NewUacValue],[UserAccountControl],[UserParameters],[SidHistory],[EventWho],[EventWhen],[EventID],[EventRecordID],[GatheredFrom],[GatheredLogName],[EventAdded],[EventAddedWho] ) VALUES ( 'AD1.ad.evotec.xyz','A user account was changed.','EVOTEC\svcTaskScheduler',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'EVOTEC\Administrator','2018-12-10 20:43:52','4738','4516514','EVO1','ForwardedEvents','2018-12-14 08:42:17','przemyslaw.klys' ) END
[14.12.2018 08:42:17][Info] MS SQL Output: IF NOT EXISTS ( SELECT 1 FROM  dbo.[Events]  WHERE [EventRecordID] = '4570878' ) BEGIN INSERT INTO  dbo.[Events] ( [DomainController],[Action],[UserAffected],[SamAccountName],[UserPrincipalName],[HomeDirectory],[HomePath],[ScriptPath],[ProfilePath],[PasswordLastSet],[AccountExpires],[PrimaryGroupId],[AllowedToDelegateTo],[OldUacValue],[NewUacValue],[UserAccountControl],[UserParameters],[SidHistory],[EventWho],[EventWhen],[EventID],[EventRecordID],[GatheredFrom],[GatheredLogName],[EventAdded],[EventAddedWho] ) VALUES ( 'AD1.ad.evotec.xyz','A user account was changed.','EVOTEC\svcTaskScheduler',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'LOCKOUT, NORMAL_ACCOUNT','LOCKOUT, NORMAL_ACCOUNT','INTERDOMAIN_TRUST_ACCOUNT',NULL,NULL,'EVOTEC\Administrator','2018-12-13 21:58:48','4738','4570878','AD1.ad.evotec.xyz','Security','2018-12-14 08:42:17','przemyslaw.klys' ) END
[14.12.2018 08:42:17][Info] MS SQL Output: IF NOT EXISTS ( SELECT 1 FROM  dbo.[Events]  WHERE [EventRecordID] = '4570882' ) BEGIN INSERT INTO  dbo.[Events] ( [DomainController],[Action],[UserAffected],[SamAccountName],[UserPrincipalName],[HomeDirectory],[HomePath],[ScriptPath],[ProfilePath],[PasswordLastSet],[AccountExpires],[PrimaryGroupId],[AllowedToDelegateTo],[OldUacValue],[NewUacValue],[UserAccountControl],[UserParameters],[SidHistory],[EventWho],[EventWhen],[EventID],[EventRecordID],[GatheredFrom],[GatheredLogName],[EventAdded],[EventAddedWho] ) VALUES ( 'AD1.ad.evotec.xyz','A user account was changed.','EVOTEC\svcTaskScheduler',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'EVOTEC\Administrator','2018-12-13 21:58:53','4738','4570882','AD1.ad.evotec.xyz','Security','2018-12-14 08:42:17','przemyslaw.klys' ) END
[14.12.2018 08:42:17][Info] MS SQL Output: IF NOT EXISTS ( SELECT 1 FROM  dbo.[Events]  WHERE [EventRecordID] = '4570945' ) BEGIN INSERT INTO  dbo.[Events] ( [DomainController],[Action],[UserAffected],[SamAccountName],[UserPrincipalName],[HomeDirectory],[HomePath],[ScriptPath],[ProfilePath],[PasswordLastSet],[AccountExpires],[PrimaryGroupId],[AllowedToDelegateTo],[OldUacValue],[NewUacValue],[UserAccountControl],[UserParameters],[SidHistory],[EventWho],[EventWhen],[EventID],[EventRecordID],[GatheredFrom],[GatheredLogName],[EventAdded],[EventAddedWho] ) VALUES ( 'AD1.ad.evotec.xyz','A user account was changed.','EVOTEC\svcTaskScheduler',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'LOCKOUT, NORMAL_ACCOUNT','LOCKOUT, NORMAL_ACCOUNT','PASSWD_NOTREQD, INTERDOMAIN_TRUST_ACCOUNT',NULL,NULL,'EVOTEC\przemyslaw.klys','2018-12-13 22:03:24','4738','4570945','EVO1','ForwardedEvents','2018-12-14 08:42:17','przemyslaw.klys' ) END
[14.12.2018 08:42:17][Info] Sending User Status to SQL at Global level
[14.12.2018 08:42:17][Info] MS SQL Output: IF NOT EXISTS ( SELECT 1 FROM  dbo.[Events]  WHERE [EventRecordID] = '4516508' ) BEGIN INSERT INTO  dbo.[Events] ( [DomainController],[Action],[EventWho],[EventWhen],[UserAffected],[EventID],[EventRecordID],[GatheredFrom],[GatheredLogName],[EventAdded],[EventAddedWho] ) VALUES ( 'AD1.ad.evotec.xyz','A user account was enabled.','EVOTEC\Administrator','2018-12-10 20:43:41','EVOTEC\svcTaskScheduler','4722','4516508','EVO1','ForwardedEvents','2018-12-14 08:42:17','przemyslaw.klys' ) END
[14.12.2018 08:42:17][Info] MS SQL Output: IF NOT EXISTS ( SELECT 1 FROM  dbo.[Events]  WHERE [EventRecordID] = '4516513' ) BEGIN INSERT INTO  dbo.[Events] ( [DomainController],[Action],[EventWho],[EventWhen],[UserAffected],[EventID],[EventRecordID],[GatheredFrom],[GatheredLogName],[EventAdded],[EventAddedWho] ) VALUES ( 'AD1.ad.evotec.xyz','A user account was disabled.','EVOTEC\Administrator','2018-12-10 20:43:45','EVOTEC\svcTaskScheduler','4725','4516513','EVO1','ForwardedEvents','2018-12-14 08:42:17','przemyslaw.klys' ) END
[14.12.2018 08:42:17][Info] MS SQL Output: IF NOT EXISTS ( SELECT 1 FROM  dbo.[Events]  WHERE [EventRecordID] = '4570879' ) BEGIN INSERT INTO  dbo.[Events] ( [DomainController],[Action],[EventWho],[EventWhen],[UserAffected],[EventID],[EventRecordID],[GatheredFrom],[GatheredLogName],[EventAdded],[EventAddedWho] ) VALUES ( 'AD1.ad.evotec.xyz','A user account was enabled.','EVOTEC\Administrator','2018-12-13 21:58:48','EVOTEC\svcTaskScheduler','4722','4570879','AD1.ad.evotec.xyz','Security','2018-12-14 08:42:17','przemyslaw.klys' ) END
[14.12.2018 08:42:17][Info] MS SQL Output: IF NOT EXISTS ( SELECT 1 FROM  dbo.[Events]  WHERE [EventRecordID] = '4570946' ) BEGIN INSERT INTO  dbo.[Events] ( [DomainController],[Action],[EventWho],[EventWhen],[UserAffected],[EventID],[EventRecordID],[GatheredFrom],[GatheredLogName],[EventAdded],[EventAddedWho] ) VALUES ( 'AD1.ad.evotec.xyz','A user account was disabled.','EVOTEC\przemyslaw.klys','2018-12-13 22:03:24','EVOTEC\svcTaskScheduler','4725','4570946','EVO1','ForwardedEvents','2018-12-14 08:42:17','przemyslaw.klys' ) END
[14.12.2018 08:42:17][Info] Sending User Status to SQL at Local level
[14.12.2018 08:42:17][Info] MS SQL Output: IF NOT EXISTS ( SELECT 1 FROM  dbo.[EventsUserStatus]  WHERE [EventRecordID] = '4516508' ) BEGIN INSERT INTO  dbo.[EventsUserStatus] ( [DomainController],[Action],[EventWho],[EventWhen],[UserAffected],[EventID],[EventRecordID],[EventAdded],[EventAddedWho] ) VALUES ( 'AD1.ad.evotec.xyz','A user account was enabled.','EVOTEC\Administrator','2018-12-10 20:43:41','EVOTEC\svcTaskScheduler','4722','4516508','2018-12-14 08:42:17','przemyslaw.klys' ) END
[14.12.2018 08:42:17][Info] MS SQL Output: IF NOT EXISTS ( SELECT 1 FROM  dbo.[EventsUserStatus]  WHERE [EventRecordID] = '4516513' ) BEGIN INSERT INTO  dbo.[EventsUserStatus] ( [DomainController],[Action],[EventWho],[EventWhen],[UserAffected],[EventID],[EventRecordID],[EventAdded],[EventAddedWho] ) VALUES ( 'AD1.ad.evotec.xyz','A user account was disabled.','EVOTEC\Administrator','2018-12-10 20:43:45','EVOTEC\svcTaskScheduler','4725','4516513','2018-12-14 08:42:17','przemyslaw.klys' ) END
[14.12.2018 08:42:17][Info] MS SQL Output: IF NOT EXISTS ( SELECT 1 FROM  dbo.[EventsUserStatus]  WHERE [EventRecordID] = '4570879' ) BEGIN INSERT INTO  dbo.[EventsUserStatus] ( [DomainController],[Action],[EventWho],[EventWhen],[UserAffected],[EventID],[EventRecordID],[EventAdded],[EventAddedWho] ) VALUES ( 'AD1.ad.evotec.xyz','A user account was enabled.','EVOTEC\Administrator','2018-12-13 21:58:48','EVOTEC\svcTaskScheduler','4722','4570879','2018-12-14 08:42:17','przemyslaw.klys' ) END
[14.12.2018 08:42:17][Info] MS SQL Output: IF NOT EXISTS ( SELECT 1 FROM  dbo.[EventsUserStatus]  WHERE [EventRecordID] = '4570946' ) BEGIN INSERT INTO  dbo.[EventsUserStatus] ( [DomainController],[Action],[EventWho],[EventWhen],[UserAffected],[EventID],[EventRecordID],[EventAdded],[EventAddedWho] ) VALUES ( 'AD1.ad.evotec.xyz','A user account was disabled.','EVOTEC\przemyslaw.klys','2018-12-13 22:03:24','EVOTEC\svcTaskScheduler','4725','4570946','2018-12-14 08:42:17','przemyslaw.klys' ) END
  • Things get shifted when you resize log window

image

I constantly move things around, depending on how long the output is. While 2nd issue can't be fixed with Clear-Host the first one can.

Just to add, I understand the complexity of it and I've already bound my Logitech G mouse button to ALT+CTRL+SHIFT+C which is Terminal Clear for me so I essentially have what I asked for in a personal way. Still a proper implementation and behavior like in ISE, PowerShell Console would be best.

@PrzemyslawKlys
Copy link
Contributor Author

I guess you could add this as an option like:

image

Where every new session it would clear screen if someone chooses so.

@SeeminglyScience
Copy link
Collaborator

@rjmholt

it might be possible to rebind Clear-Host in the integrated console

I recently realized this would actually be really easy to change without even touching any commands.

Clear-Host hits this code path and should be pretty much the only thing that does. PSES could send an event that the client could use to "really" clear the terminal if needed.

I would say we should leave this to xterm.js but it's already been quite awhile since this was initially reported and I've heard a few people refer to this as a blocker for switching from the ISE.

@TylerLeonhardt
Copy link
Member

That makes sense. If we down that route we should finally properly implement editor capabilities so that a client (not the user) could specify supportsNativeConsoleClearing which would impact this behavior.

@rjmholt
Copy link
Contributor

rjmholt commented Dec 14, 2018

I would say we should leave this to xterm.js

I was thinking about this again and it struck me that the host is usually beyond PowerShell's control except for an API; we really shouldn't have to do anything special with Clear-Host unless our readline reimplemenation has broken something.

Does Clear-Host work with ordinary PowerShell in VSCode?

@PrzemyslawKlys
Copy link
Contributor Author

@rjmholt Yes it does.

@TylerLeonhardt
Copy link
Member

TylerLeonhardt commented Dec 14, 2018

forgive me I have not been keeping up on the clearing issue in xtermjs. The problem here is actually winpty:
microsoft/vscode#45693

P.S. Clearing on unix in PowerShell or bash simply scrolls... so I don't think we'll ever have the experience you want on non-Windows.

@SeeminglyScience
Copy link
Collaborator

@rjmholt

Does Clear-Host work with ordinary PowerShell in VSCode?

It does the same thing in and out of PSIC, it's definitely a xterm.js thing (or a nodepty thing?). There's an issue somewhere discussing it.

My idea was to send a custom LSP event that the client could listen for and invoke a custom command to "properly" clear the terminal.

Also I agree that we shouldn't have to do anything special, but I'm not sure it'll ever be fixed in that case.

@TylerLeonhardt
Copy link
Member

Before we go down this route of making a new message, I want to see some more data that this is THE issue blocking people from switching.

Anything that we do to support this would be a workaround - not a feature.

@PrzemyslawKlys I understand your frustration here - but it makes me very uneasy to implement workarounds like this.

I think you should open an issue on VSCode to add a "Clear" button next to the trash can that would do the clearing. I'm pretty sure other IDEs have done similar things.

... at least until winpty fixes the underlying issue.

@PrzemyslawKlys
Copy link
Contributor Author

@TylerLeonhardt to be honest I don't need it. I fixed my G button on my mouse so I explicitly can use this. I would like to have Clear-Host working properly but if it can't be fixed, it can't be fixed.

Related items:

#551
#432

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants