Summary
Invoke-RemoteScriptAsync in modules/SPE/Invoke-RemoteScript.ps1 is exported from the module but effectively dead code:
- No callers anywhere in the codebase
- Tests are commented out in
tests/integration/Remoting.Automation.Tests.ps1
- No documentation references it
- Returns raw
Task objects requiring .Result access — awkward PowerShell UX
The -AsJob switch on Invoke-RemoteScript covers the same async use case and is actively used/documented.
Changes
- Remove
Invoke-RemoteScriptAsync function from modules/SPE/Invoke-RemoteScript.ps1
- Remove from
FunctionsToExport in modules/SPE/SPE.psd1
- Remove commented-out async tests from
tests/integration/Remoting.Automation.Tests.ps1
- Remove supporting utilities if no longer needed:
New-RunspacedDelegate.ps1, Invoke-GenericMethod.ps1
Justification
Cleaning up dead code as part of the 9.0 release. Major version bump makes this a non-breaking change window.
Summary
Invoke-RemoteScriptAsyncinmodules/SPE/Invoke-RemoteScript.ps1is exported from the module but effectively dead code:tests/integration/Remoting.Automation.Tests.ps1Taskobjects requiring.Resultaccess — awkward PowerShell UXThe
-AsJobswitch onInvoke-RemoteScriptcovers the same async use case and is actively used/documented.Changes
Invoke-RemoteScriptAsyncfunction frommodules/SPE/Invoke-RemoteScript.ps1FunctionsToExportinmodules/SPE/SPE.psd1tests/integration/Remoting.Automation.Tests.ps1New-RunspacedDelegate.ps1,Invoke-GenericMethod.ps1Justification
Cleaning up dead code as part of the 9.0 release. Major version bump makes this a non-breaking change window.