🩹 [Patch]: Add network and public IP information#13
🩹 [Patch]: Add network and public IP information#13Marius Storhaug (MariusStorhaug) merged 3 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the PowerShell diagnostics script by adding network configuration and public IP information gathering capabilities. The changes install two new PowerShell modules and create dedicated log groups to display network details during script execution.
Key changes:
- Installation of Net and PublicIP PowerShell modules from PSGallery
- Addition of network configuration display using Get-NetIPConfiguration
- Addition of public IP information display using Get-PublicIP
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| $PSStyle.OutputRendering = 'Ansi' | ||
| Install-PSResource -Repository PSGallery -TrustRepository -Name Net | ||
| Install-PSResource -Repository PSGallery -TrustRepository -Name PublicIP |
There was a problem hiding this comment.
Installing modules without version pinning poses security risks. Consider specifying exact versions or version ranges to ensure reproducible builds and prevent potential supply chain attacks.
| Install-PSResource -Repository PSGallery -TrustRepository -Name PublicIP | |
| Install-PSResource -Repository PSGallery -TrustRepository -Name PublicIP -RequiredVersion 2.1.0 |
| Install-PSResource -Repository PSGallery -TrustRepository -Name Net | ||
| Install-PSResource -Repository PSGallery -TrustRepository -Name PublicIP |
There was a problem hiding this comment.
Module installation commands lack error handling. If installation fails, subsequent Get-NetIPConfiguration and Get-PublicIP commands will fail. Consider adding try-catch blocks or conditional checks.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Description
This pull request updates the
scripts/main.ps1PowerShell script to enhance its network diagnostics capabilities by installing two new modules and adding commands to display network configuration and public IP information. The most important changes are grouped below:Module installation:
NetandPublicIPmodules from the PowerShell Gallery to ensure required commands are available.Network diagnostics:
Get-NetIPConfigurationto display detailed local network configuration.Get-PublicIPto display the machine's public IP address.