PowerShell: Difference between revisions

From Han Wiki
Jump to navigation Jump to search
Check for an open port
Tag: visualeditor
mNo edit summary
Line 1: Line 1:
== Check for an open port ==
== Check for an open port ==
<source lang="powershell">
<syntaxhighlight lang="powershell">
PS C:\Users\MHan> Test-NetConnection -ComputerName island.doodle.com -Port 443
PS C:\Users\MHan> Test-NetConnection -ComputerName island.doodle.com -Port 443
</source>
</syntaxhighlight>


== Search files ==
== Search files ==


<source lang="powershell">
<syntaxhighlight lang="powershell">
PS C:\Users\MHan> Get-ChildItem -Recurse -Include *.* | Select-String "text to search for"
PS C:\Users\MHan> Get-ChildItem -Recurse -Include *.* | Select-String "text to search for"
</source>
</syntaxhighlight>




== Check version ==
== Check version ==


<source lang="powershell">
<syntaxhighlight lang="powershell">
PS C:\Users\MHan> $PSversionTable
PS C:\Users\MHan> $PSversionTable


Line 26: Line 26:
SerializationVersion          1.1.0.1
SerializationVersion          1.1.0.1


</source>
</syntaxhighlight>

Revision as of 07:52, 31 August 2023

Check for an open port

PS C:\Users\MHan> Test-NetConnection -ComputerName island.doodle.com -Port 443

Search files

PS C:\Users\MHan> Get-ChildItem -Recurse -Include *.* | Select-String "text to search for"


Check version

PS C:\Users\MHan> $PSversionTable

Name                           Value
----                           -----
PSVersion                      5.0.10586.1417
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.10586.1417
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1