Skip to content

Enable post-network script execution and optionally suppress module auto-updates (Initialize-OSDCloudStartnet.ps1) #288

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KatsuhiroWatanabe
Copy link

@KatsuhiroWatanabe KatsuhiroWatanabe commented Jul 7, 2025

Summary

This PR introduces two enhancements to the OSDCloudStartnet initialization process:

  1. Post-Network Script Execution
    A custom PowerShell script can now be executed after a network connection is established.

    • Supports execution after establishing either Wi-Fi or wired (Ethernet) connections
    • Script location is defined via a new template variable pointing to the OSDCloud\Config\StarNet2 folder
  2. Optional Suppression of Module Auto-Update
    The automatic update of OSD modules can now be disabled by setting { "OSDAutoUpdate": false } in
    OSDCloud\Config\Initialize-OSDCloudStartnet.json.

    • If the setting is omitted, the default behavior (auto-update enabled) is preserved.
    • This prevents customizations in OSD modules from being overwritten by Import-Module -Force, ensuring consistent behavior in customized environments.

Motivation

These changes provide greater control and flexibility during the early stages of OSDCloud initialization, especially in environments where deterministic behavior or offline operation is required.

A typical use case involves hosting pre-validated catalog files of company standard device models on external storage (e.g., Azure Blob) and downloading them during initialization. This approach avoids relying on the generic catalogs bundled with the latest module versions, which—while always up-to-date—may not reflect the specific validation or optimization required for certain hardware models. Suppressing automatic updates helps preserve these curated configurations and ensures consistent deployment behavior.

Notes

  • Backward compatible: no impact on existing templates unless the new features are explicitly used.

…pression

Enhanced Initialize-OSDCloudStartNet.ps1 to support execution custom PowerShell scripts after establishing a network connection.

Added support for suppressing automatic updates of the lastest OSD module.
@KatsuhiroWatanabe
Copy link
Author

I accidentally named this branch feature/InintStartNet2 instead of feature/InitStartNet2. Since it's already in use and to avoid any risky operations like renaming or recreating the PR, I'll proceed with it as is.

@KatsuhiroWatanabe KatsuhiroWatanabe changed the title Add post-network script execution and optional module auto-update sup… Enable post-network script execution and optionally suppress module auto-updates Jul 9, 2025
@KatsuhiroWatanabe KatsuhiroWatanabe changed the title Enable post-network script execution and optionally suppress module auto-updates Enable post-network script execution and optionally suppress module auto-updates (Initialize-OSDCloudStartnet.ps1) Jul 9, 2025
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.

1 participant