This pull request introduces several changes to the PowerShell cmdlets and module classes in the powershell/cmdlets/class.ts, powershell/generators/psm1.ts, and powershell/module/module-class.ts files. The changes mainly focus on implementing telemetry and output sanitization features. The most significant changes include the addition of a new NewImplementWriteObject method, the introduction of new delegates for sanitizing output and getting telemetry information, and the inclusion of these delegates in the CmdletClass and NewModuleClass.
Telemetry and Output Sanitization:
[powershell/cmdlets/class.ts]: Added a new method NewImplementWriteObject to sanitize output objects and write them to the pipeline. This method includes two overloads for handling single objects and collections.
[powershell/cmdlets/class.ts]: Added code to retrieve telemetry information and display a warning if the cmdlet output may compromise security.
[powershell/generators/psm1.ts]: Added delegates for sanitizing output and getting telemetry information to the module instance.
New Delegates:
[powershell/module/module-class.ts]: Introduced new delegates SanitizerDelegate and GetTelemetryInfoDelegate for sanitizing output and getting telemetry information, respectively.
This pull request introduces several changes to the PowerShell cmdlets and module classes in the
powershell/cmdlets/class.ts
,powershell/generators/psm1.ts
, andpowershell/module/module-class.ts
files. The changes mainly focus on implementing telemetry and output sanitization features. The most significant changes include the addition of a newNewImplementWriteObject
method, the introduction of new delegates for sanitizing output and getting telemetry information, and the inclusion of these delegates in theCmdletClass
andNewModuleClass
.Telemetry and Output Sanitization:
powershell/cmdlets/class.ts
]: Added a new methodNewImplementWriteObject
to sanitize output objects and write them to the pipeline. This method includes two overloads for handling single objects and collections.powershell/cmdlets/class.ts
]: Added code to retrieve telemetry information and display a warning if the cmdlet output may compromise security.powershell/generators/psm1.ts
]: Added delegates for sanitizing output and getting telemetry information to the module instance.New Delegates:
powershell/module/module-class.ts
]: Introduced new delegatesSanitizerDelegate
andGetTelemetryInfoDelegate
for sanitizing output and getting telemetry information, respectively.