Does all PS module run on linus machine as well as windows?

hi
i installed network module on my ubuntu 22.04 but command does not run
here is my outputL

PS /> Get-Command -module Network

CommandType Name Version Source


Alias Add-WebSecurityProtocol 0.9.1 Network
Alias Expand-Url 0.9.1 Network
Function Add-HostsFileEntry 0.9.1 Network
Function Clear-DnsCache 0.9.1 Network
Function Convert-CidrToDottedSubnetMask 0.9.1 Network
Function Convert-SubnetMaskToCidr 0.9.1 Network
Function ConvertTo-DecimalIP 0.9.1 Network
Function ConvertTo-DottedDecimalIP 0.9.1 Network
Function Disable-Proxy 0.9.1 Network
Function Enable-Proxy 0.9.1 Network
Function Expand-Uri 0.9.1 Network
Function Get-DnsAddressList 0.9.1 Network
Function Get-DnsCache 0.9.1 Network
Function Get-DNSDebugLog 0.9.1 Network
Function Get-DNSScavengeRecord 0.9.1 Network
Function Get-HostsFile 0.9.1 Network
Function Get-MyIpAddress 0.9.1 Network
Function Get-Netstat 0.9.1 Network
Function Get-Proxy 0.9.1 Network
Function Get-WebCertificate 0.9.1 Network
Function Get-WebSecurityProtocol 0.9.1 Network
Function Import-509Certificate 0.9.1 Network
Function Invoke-DNSManualCleanUp 0.9.1 Network
Function Remove-HostsFileEntry 0.9.1 Network
Function Send-WakeOnLan 0.9.1 Network
Function Set-WebCertificatePolicy 0.9.1 Network
Function Set-WebSecurityProtocol 0.9.1 Network
Function Test-CertificateAuthorityPlacement 0.9.1 Network

PS /> Get-Netstat
ConvertFrom-String: The term ‘ConvertFrom-String’ is not recognized as a name of a cmdlet, function, script
file, or executable program. Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.

what should i do ?

The short answer, no.
Looking at this particular module source. It is very much geared toward Windows systems.

Soheil,
Welcome to the forum. :wave:t3:

When you post code, sample data, console output or error messages please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.

Thanks in advance

How to format code in PowerShell.org 1 <---- Click :point_up_2:t4: :wink:

( !! Sometimes the preformatted text button hides behind the settings gear symbol. :wink: )

Your first stop should always be the documentation. There you can see that this command is part of the Windows PowerShell. So it is not available in version 6 and higher.

You may try if

does the trick for your purpose. :wink:

1 Like

You could try out my Get-NetStat - it does not depend on ConvertFrom-String and works in powershell 6+

1 Like

So the function I made really was just for windows as well. I’ve added some linux support (TCP) as I don’t have a linux machine that has UDP connections at the moment. Naturally, netstat command line utility must be present for the function to work.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.