Skip to content

Remove Invoke-RemoteScriptAsync (dead code) #1414

@michaellwest

Description

@michaellwest

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions