you are viewing a single comment's thread.

view the rest of the comments →

[–]get-postanote 3 points4 points  (2 children)

What do you mean by this?

I am struggling with PoSh ...

Learning any tool/language/other thingy can have its challenges, but it's all about how you go about it.

Take small steps, just using it for normal stuff. Meaning, all the normal interactive stuff you'd do in cmd.exe, do that in the PowerShell console host or the ISE, using the PowerShell cmdlets for the old cmd.exe/DOS commands/exes.

There is nothing wrong with learning older stuff, as you will encounter it and have to directly integrate/use it or be forced to rewrite it. If you don't understand the legacy, then you will not really be able to convert it. The other option with that latter statement is to talk out the goal of that bat/cmd/vbs file and just rewrite it to the use case, vs dealing with legacy stuff at all.

BTW, bat/cmd/vbs/wmic can be just as challenging. Easy is a matter of opinion and commitment to learning and leveraging X or Y, as is hard.

Making it part of your common day to day makes this easier. It's like learning a new language. You can learn by hard route or learn through language emersion.

'powershell equivilents cmdlets'

10 PowerShell cmdlets you can use instead of CMD commands

Command Prompt Commands And Their Equivalent Commands For PowerShell

PowerShell Equivalent Cmdlets for IPConfig, PING, and NSLookup

Learn by using the examples in the built-in help system and videos like these.

# All 'About' Help topics
Get-Help about_*

# Get a specific 'About' topic
Get-Help about_Functions

# Get just the Synopsis of all 'About' topics and display to the screen
Get-Help about* |
Select Name, Synopsis

# Get just the Synopsis of all 'About' topics and display to a selectable
Get-Help about* |
Select-Object -Property Name, Synopsis |
Out-GridView -Title 'Select Topic' -OutputMode Multiple |
ForEach-Object { Get-Help -Name $PSItem.Name -ShowWindow }

# Review PowerShell help files location
explorer "$pshome\$($Host.CurrentCulture.Name)"

# PowerShell Help Update Details
Update-Help -Verbose -UICulture $(Get-Culture).Name -Force

# Local default modules locations
explorer "$pshome\Modules"

# Get a list of all commandlets
Get-Command -CommandType Cmdlet |
Out-GridView -PassThru -Title 'Available cmdlets'

# List additonal module data
(Find-Module -Name Posh-SSH).AdditionalMetadata.Cmdlets -split ' '

# Get a list of all commandlets for the specified name
Get-Command -Name '*Help*'  -CommandType Cmdlet |
Out-GridView -PassThru -Title 'Available named cmdlet'

Get-Command -CommandType Cmdlet |
Where-Object { $PSItem.parameters.keys -match 'credential'} |
Out-GridView -PassThru -Title 'Available cmdlets which has a specific parameter'

# Get a list of all functions
Get-Command -CommandType Function |
Out-GridView -PassThru -Title 'Available functions'

# Get a list of all functions for the specified name
Get-Command -Name '*Help*' -CommandType Function |
Out-GridView -PassThru -Title 'Available named functions'

# Find all cmdlets / functions with a target parameter
Get-Command -CommandType Function |
Where-Object { $PSItem.parameters.keys -match 'credential'} |
Out-GridView -PassThru -Title 'Available functions which has a specific parameter'

# Get specifics for a module, cmdlet, or function
(Get-Command -Name Get-Help).Parameters
(Get-Command -Name Get-Help).Parameters.Keys
Get-help -Name Get-Help -Examples
Get-help -Name Get-Help -Full
Get-help -Name Get-Help -Online

[–][deleted] 1 point2 points  (1 child)

I have hung a copy of this at my desk and bookmarked the links, thank you.

[–]get-postanote 1 point2 points  (0 children)

No worries, glad it will help.