PowerShell: Difference between revisions

278 bytes added ,  19 October 2023
Comparison with Linux commands
mNo edit summary
Comparison with Linux commands
Tag: visualeditor
Line 1: Line 1:
== Check for an open port ==
== Check for an open port ==
<syntaxhighlight lang="powershell">
<syntaxhighlight lang="powershell">
PS C:\Users\MHan> Test-NetConnection -ComputerName island.doodle.com -Port 443
P> Test-NetConnection -ComputerName island.doodle.com -Port 443
</syntaxhighlight>
</syntaxhighlight>


Line 9: Line 9:
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"
</syntaxhighlight>
</syntaxhighlight>


== Check version ==
== Check version ==
Line 27: Line 26:


</syntaxhighlight>
</syntaxhighlight>
== Comparison with Linux commands ==
{| class="wikitable"
|+
!Action
!PowerShell
!Linux
|-
|Search for a string
|<nowiki>az keyvault list | findstr -i 'name":'</nowiki>
|<nowiki>az keyvualt list | grep -i 'name";'</nowiki>
|-
|Alias a command
|new-alias grep findstr
|alias g grep
|-
|
|
|
|}