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

Fixes #11188 - Add note about the interactive nature of Enter-PSSession #11189

Merged
merged 1 commit into from
Jun 14, 2024

Conversation

sdwheeler
Copy link
Contributor

@sdwheeler sdwheeler commented Jun 14, 2024

PR Summary

Add note about the interactive nature of Enter-PSSession

PR Checklist

  • Descriptive Title: This PR's title is a synopsis of the changes it proposes.
  • Summary: This PR's summary describes the scope and intent of the change.
  • Contributor's Guide: I have read the contributors guide.
  • Style: This PR adheres to the style guide.

Copy link
Contributor

Learn Build status updates of commit ea378a5:

✅ Validation status: passed

File Status Preview URL Details
reference/5.1/Microsoft.PowerShell.Core/Enter-PSSession.md ✅Succeeded View (powershell-5.1)
reference/7.2/Microsoft.PowerShell.Core/Enter-PSSession.md ✅Succeeded View (powershell-7.2)
reference/7.4/Microsoft.PowerShell.Core/Enter-PSSession.md ✅Succeeded View (powershell-7.4)
reference/7.5/Microsoft.PowerShell.Core/Enter-PSSession.md ✅Succeeded View (powershell-7.5)

For more details, please refer to the build report.

For any questions, please:

@michaeltlombardi michaeltlombardi merged commit 887585a into MicrosoftDocs:main Jun 14, 2024
6 checks passed
@@ -89,6 +89,10 @@ interactive session. However, you cannot use the `Disconnect-PSSession`, `Connec
To end the interactive session and disconnect from the remote computer, use the `Exit-PSSession`
cmdlet, or type `exit`.

> [!IMPORTANT]
> `Enter-PSSession` is designed to substitute a new remote session for the current interactive
> session. You shouldn't call it from within script context.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick turnaround.

I assume that "a" is missing from "from within script context",
though I suggest mentioning the CLI also, along the lines of:

"You shouldn't call it from a script file or via the PowerShell CLI."

@sdwheeler sdwheeler deleted the sdw-w0-i11188 branch June 14, 2024 18:27
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

Successfully merging this pull request may close these issues.

Document that Enter-PSSession cannot be called from scripts or via the CLI
3 participants