Guild of Microsoft a basic Question regarding Powershell
Howdy Guys.
I am looking at some Powershell stuff, I have been watching CBT nuggets videos by Don Jones. Figured I would attempt to build a solid foundation before I tackle some scripting. I primarily run Linux so making the transition has been a bit eventful shall we say. Dear guild of Microsoft I propose the following.
I am struggling to understand and get to grips with syntax, This has always been a weakness for me including Linux so I figured you guys could break things down and cement concepts so that I can take notes and keep a reference.
So here we go:
If I run the following: get-help get-eventlog | more
I am struggling to understand syntax and order of operation what the brackets mean etc. like what does [] <> [[] mean? I kinda understand some parts. However I could really do with some guidance in cementing these concepts.
Get-EventLog [-LogName] <String> [[-InstanceId] <Int64[]>] [-After <DateTime>] [-AsBaseObject] [-Before <DateTime>] [-ComputerName <String[]>] [-EntryType
<String[]> {Error | Information | FailureAudit | SuccessAudit | Warning}] [-Index <Int32[]>] [-Message <String>] [-Newest <Int32>] [-Source <String[]>] [-User
<String[]>] [<CommonParameters>]
Go easy on me guys I need to be spoon fed break it down in a really noob friendly way
As always I appreciate all the guidance from this wonderful forum.
I am looking at some Powershell stuff, I have been watching CBT nuggets videos by Don Jones. Figured I would attempt to build a solid foundation before I tackle some scripting. I primarily run Linux so making the transition has been a bit eventful shall we say. Dear guild of Microsoft I propose the following.
I am struggling to understand and get to grips with syntax, This has always been a weakness for me including Linux so I figured you guys could break things down and cement concepts so that I can take notes and keep a reference.
So here we go:
If I run the following: get-help get-eventlog | more
I am struggling to understand syntax and order of operation what the brackets mean etc. like what does [] <> [[] mean? I kinda understand some parts. However I could really do with some guidance in cementing these concepts.
Get-EventLog [-LogName] <String> [[-InstanceId] <Int64[]>] [-After <DateTime>] [-AsBaseObject] [-Before <DateTime>] [-ComputerName <String[]>] [-EntryType
<String[]> {Error | Information | FailureAudit | SuccessAudit | Warning}] [-Index <Int32[]>] [-Message <String>] [-Newest <Int32>] [-Source <String[]>] [-User
<String[]>] [<CommonParameters>]
Go easy on me guys I need to be spoon fed break it down in a really noob friendly way
As always I appreciate all the guidance from this wonderful forum.
Microsoft's strategy to conquer the I.T industry
" Embrace, evolve, extinguish "
" Embrace, evolve, extinguish "
Comments
-
636-555-3226 Member Posts: 975 ■■■■■□□□□□My coworkers and I found a lot of value in the "PowerShell in a month of lunches" series. Not 100% perfect, but a great resource for learning, and relatively cheap
https://www.amazon.com/s/ref=nb_sb_ss_c_2_23?url=search-alias%3Dstripbooks&field-keywords=powershell+in+a+month+of+lunches&sprefix=powershell+in+a+month+o%2Caps%2C130&crid=3KIPS1STNAYJ9&rh=n%3A283155%2Ck%3Apowershell+in+a+month+of+lunches -
blargoe Member Posts: 4,174 ■■■■■■■■■□Howdy Guys.
I am looking at some Powershell stuff, I have been watching CBT nuggets videos by Don Jones. Figured I would attempt to build a solid foundation before I tackle some scripting. I primarily run Linux so making the transition has been a bit eventful shall we say. Dear guild of Microsoft I propose the following.
I am struggling to understand and get to grips with syntax, This has always been a weakness for me including Linux so I figured you guys could break things down and cement concepts so that I can take notes and keep a reference.
So here we go:
If I run the following: get-help get-eventlog | more
I am struggling to understand syntax and order of operation what the brackets mean etc. like what does [] <> [[] mean? I kinda understand some parts. However I could really do with some guidance in cementing these concepts.
Get-EventLog [-LogName] <String> [[-InstanceId] <Int64[]>] [-After <DateTime>] [-AsBaseObject] [-Before <DateTime>] [-ComputerName <String[]>] [-EntryType
<String[]> {Error | Information | FailureAudit | SuccessAudit | Warning}] [-Index <Int32[]>] [-Message <String>] [-Newest <Int32>] [-Source <String[]>] [-User
<String[]>] [<CommonParameters>]
Go easy on me guys I need to be spoon fed break it down in a really noob friendly way
As always I appreciate all the guidance from this wonderful forum.
From your above example:
[[-InstanceId] <Int64[]>] indicates that the -InstanceId parameter is optional. The parameter is type Int64, the [] means that it accepts multiple Int64 values.
For Instance, get-eventlog application -InstanceId 1,2IT guy since 12/00
Recent: 11/2019 - RHCSA (RHEL 7); 2/2019 - Updated VCP to 6.5 (just a few days before VMware discontinued the re-cert policy...)
Working on: RHCE/Ansible
Future: Probably continued Red Hat Immersion, Possibly VCAP Design, or maybe a completely different path. Depends on job demands...