Skip to content

Conversation

@RustyTake-Off
Copy link

@RustyTake-Off RustyTake-Off commented Dec 4, 2025

Summary

Fixed critical logic error and improved error handling in the PowerShell token acquisition script docs.

Issues Fixed

  1. Main script logic was executing even when module installation failed
  2. Improved process execution with Start-Process -Wait
  3. Added proper error handling for cleanup operations
  4. Enhanced user feedback with progress messages
  5. Fixed typos in comments

Testing

  • Script successfully downloads and installs connector
  • Token acquisition works correctly
  • Cleanup operations complete without errors

@RustyTake-Off
Copy link
Author

@microsoft-github-policy-service agree

@prmerger-automator
Copy link
Contributor

@RustyTake-Off : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change.

@learn-build-service-prod
Copy link
Contributor

Learn Build status updates of commit 6a62f3d:

✅ Validation status: passed

File Status Preview URL Details
docs/global-secure-access/scripts/powershell-get-token.md ✅Succeeded

For more details, please refer to the build report.

@prmerger-automator
Copy link
Contributor

PRMerger Results

Issue Description
File Change Percent This PR contains file(s) with more than 30% file change.

@v-dirichards
Copy link
Contributor

@kenwith

Can you review the proposed changes?

Important: When the changes are ready for publication, adding a #sign-off comment is the best way to signal that the PR is ready for the review team to merge.

#label:"aq-pr-triaged"
@MicrosoftDocs/public-repo-pr-review-team

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a critical logic error in the PowerShell token acquisition script documentation and enhances error handling throughout. The main issue addressed is that the script would continue executing even when the connector module installation failed, leading to runtime errors.

Key Changes

  • Critical logic fix: Wrapped the main script logic (lines 87-161) inside the module existence check to prevent execution when installation fails
  • Improved process execution: Added -Wait parameter to Start-Process calls to ensure installers complete before continuing
  • Enhanced error handling: Added existence checks and -ErrorAction SilentlyContinue for cleanup operations to prevent failures during cleanup

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants