-
Notifications
You must be signed in to change notification settings - Fork 8
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
Test-NetConnection
is not valid for Powershell 7
#84
Comments
We have some code in another module that will correct this issue. |
I thought we did, just did not want to make the change with out approval |
Take a look at |
could we add the Test-EndpointConnection to PowerManagement and just update all Test-NetConnections to Test-EndpointConnection? we can make the Function not Export |
Yea, as long as the scripts do not use it directly. |
Test-NetConnection is only supported for Powershell Desktop not Core, I have updated the Test-NetConnection to be Test-EndpointConnection. Updated all documentation to add PowerValidatedSolutions as a module Signed-off-by: Jared Burns <[email protected]>
Push with change from Test-NetConnection to Test-Endpoint Complete |
Test-NetConnection
is not valid for Powershell 7
I'm going to lock this issue because it has been closed for 30 days. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Code of Conduct
VMware Cloud Foundation
5.0.0.0
PowerShell Version
Core Powershell 7.3.11
PowerCLI Version
13.2.1.22851661
Module Version
lastest
PowerVCF Version
2.4.1.1000
Guest Operating System
Mac
Environment Details
Environment is a VCF 5.0.0 with one Management Domain and VI domain
Description
Code is using Test-NetConnection in multiple Functions and if a customer uses Core Powershell not Desktop, customer will get errors around connection to vCenter or NSX not able to connect. This will cause errors like:
ERROR Connection to 'XXXXXX' has failed. Check your environment and try again
[01-16-2024_17:36:20] ERROR at Script Line 148
[01-16-2024_17:36:20] Relevant Command: Write-PowerManagementLogMessage -Type ERROR -Message "Connection to '$server' has failed. Check your environment and try again" -Colour Red
[01-16-2024_17:36:20] ERROR Message: Connection to 'XXXXXXXX' has failed. Check your environment and try again
Need to update code to check Desktop vs Core on Powershell
Error or Debug Output
ERROR Connection to 'XXXXXX' has failed. Check your environment and try again
[01-16-2024_17:36:20] ERROR at Script Line 148
[01-16-2024_17:36:20] Relevant Command: Write-PowerManagementLogMessage -Type ERROR -Message "Connection to '$server' has failed. Check your environment and try again" -Colour Red
[01-16-2024_17:36:20] ERROR Message: Connection to 'XXXXXXXX' has failed. Check your environment and try again
Expected Behavior
INFO Connecting to 'jbvcfmgtvc01.vsanpe.vmware.com'...
[01-16-2024_17:46:12] INFO Connected to server 'XXXXXXX' and attempting to shut down nodes 'XXXX'...
Actual Behavior
ERROR Connection to 'XXXXXX' has failed. Check your environment and try again
[01-16-2024_17:36:20] ERROR at Script Line 148
[01-16-2024_17:36:20] Relevant Command: Write-PowerManagementLogMessage -Type ERROR -Message "Connection to '$server' has failed. Check your environment and try again" -Colour Red
[01-16-2024_17:36:20] ERROR Message: Connection to 'XXXXXXXX' has failed. Check your environment and try again
Steps to Reproduce
Run any of the functions that on Test-NetConnection in a IF statement with a Core Install of Powershell
Log Fragments and Files
No response
Screenshots
No response
References
No response
The text was updated successfully, but these errors were encountered: