?
Solved

PowerShell Questions

Posted on 2011-10-18
6
Medium Priority
?
741 Views
Last Modified: 2012-05-12
I'm forcing myself tol learn powershell and have downloaded POwerGUI to help me in the learning processs.

Please correct me if any my statements are incorrect.
1) The default view for information in powershelll seems to be a table format.
2) The main difference between powershell 1.0 and 2.0 is the fact 2.0 added WinRM for remote management and control.
3) Powershell give admin the ability to access core componets of the OS which were very differcult to not access until now.
4) each cmdlet is a .NEt commmand??

what is the purpose for show-eventlog when it just brings up the event log gui interface?
0
Comment
Question by:compdigit44
  • 2
  • 2
  • 2
6 Comments
 
LVL 71

Expert Comment

by:Qlemo
ID: 36989355
1) No. If there are less than 4 properties to display, and those properties can be displayed as a string, format-table is done (resulting in table layout). Else the output is formatted as a  name - value list (format-list).

2) You could say so. There are some other minor improvements, like some commands allowing to use -ComputerName (so no need to use WinRM for some commandlets).

3) You could access those components with WSH already (writing VBScript or JScript batch files). But PowerShell makes it much more easy to process results, handle objects and the like.

4) No. Commandlets can also be PowerShell script blocks.

Regarding show-eventlog: well, it is just that. Use Get-WinEvent if you want to have something more useful.
0
 
LVL 8

Accepted Solution

by:
Brent Challis earned 1000 total points
ID: 36990343
My 2 cents worth:

2: Besides the evolutionary changes going from ver 1 to ver 2, there is also the ability to work with background jobs, the inclusion of a scripting editor (PowerShell_ISE) and the move to being able to extend functionality with modules as opposed to snapins.

3. PowerShell is, in many ways, as much a philosophy as it is a technology.  It is a command line equivalent of the Management Console providing a consistent way of working with and automating not only the core operating system functionality (there are some great wrappers which making working with WMI and Active Directory so much easier) but also server technologoes such as SharePoint.  It is also being picked up by vendors other than Microsoft such as VMWare who provide PowerCLI.  Also, as it is built on top of the .NET Framework it also provides access to all the functionality of .NET as well.

4. Cmdlets can be written in .Net languages, and in Ver 1 this was the only option and also in the PowerShell scripting language which makes it much easier to parcel up functionality for reuse - which is, in part - answering question 2 as well.

There are some very good online resources to help get your head around what PowerShell is and what it can do for you, and some very good books.  One of my favourite books is PowerShell in Practice by Richard Siddaway.  There is a very large community of people to help you get up to speed with PowerShell, such as the community here, and many others.  I subscribe to the Your PowerTip of the Day: from Powershell.com

The best way to learn PowerShell though, in my opinion, is through your fingers by writing scripts.
0
 
LVL 20

Author Comment

by:compdigit44
ID: 36992658
I just the hardest thing for me being a server admin and not a programmer is understaing the whole classes and object idea. I just cannot grasp this. I do understand how Powershell help programmers because they do not have to write code twice one for a GUI and the other for a command line.
0
What Security Threats Are We Predicting for 2018?

Cryptocurrency, IoT botnets, MFA, and more! Hackers are already planning their next big attacks for 2018. Learn what you might face, and how to defend against it with our 2018 security predictions.

 
LVL 20

Author Comment

by:compdigit44
ID: 36993889
I guess one of the problems I have with PowerShell is understanding what is really BUYS me over using the GUI...
0
 
LVL 71

Assisted Solution

by:Qlemo
Qlemo earned 1000 total points
ID: 36993929
You will find that more and more of the GUI stuff is only generating PowerShell commands. Exchange 2007 and above are examples for that, and the new MSSQL Server is also using PowerShell to process its GUI tasks.

If you are a visual type of admin, PS doesn't buy you anything. Use the GUI (if available), and do not bother what happens in the background.

If you want to process the same change to some Exchange mailboxes, you won't happen to manage thaat easily with the GUI - but PowerShell will do that for you in a glance, if you know how.

Whatsoever, are your initial questions answered?
0
 
LVL 8

Expert Comment

by:Brent Challis
ID: 36996245
As an extension to Qlemo's answer, PowerShell is also extremely useful when you frequently want to do a focussed task.  For example I wanted to be able to easily track how far through my monthly download quota I am, so (as it was good to practice) I wrote a PowerShell script to do it (http://powershell.com/cs/media/p/9650.aspx), added it to my profile so any time I want to check I simply open a PowerShell window and enter
Get-DownloadQuotaLevel 86
for example, or more seriously i could create a function in my profiles such that I could then simply type
Get-ExpiringAccounts
to get a list of accounts that were going to expire in the next, say, month.
0

Featured Post

What Security Threats Are We Predicting for 2018?

Cryptocurrency, IoT botnets, MFA, and more! Hackers are already planning their next big attacks for 2018. Learn what you might face, and how to defend against it with our 2018 security predictions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
In the absence of a fully-fledged GPO Management product like AGPM, the script in this article will provide you with a simple way to watch the domain (or a select OU) for GPOs changes and automatically take backups when policies are added, removed o…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question