Skip to main content

Posts

Showing posts from August, 2016

Another Advantage of Write-Information

Yesterday, at the end of my post, I mentioned that displaying information on the screen can slow down processing time.  It is true.  Here is a simple test. First of all, execute this code in the ISE Function Test-Information { [ cmdletbinding () ] Param () For ( $X = 0 ; $X -lt 1000 ; $X ++ ) {     Write-Information -MessageData "The value of X is $X " }     Write-Information -MessageData "Script Complete" -InformationAction Continue } Next execute this line of code. PS C:\> Measure-Command -Expression {Test-Information} Script Complete Days              : 0 Hours             : 0 Minutes           : 0 Seconds           : 0 Milliseconds   ...

How to use Write-Information

It is always fun to write on a topic that people are passionate about.  Yes, we will be talking about Write-Host in this post.  I know, you either love it or you hate it. PowerShell uses different “streams” of information.  Here is a quick visual. Stream |  Definition             | Cmdlet 1      |  Success output         | Write-Output       2      |  Errors                 | Write-Error        3      |  Warning messages       | Write-Warning      4      |  Verbose output         | Write-Verbose...

What Version of Windows are on my Clients?

It has been a very busy few months for me.  As you can see below, I’ve been spending a little time on board some Ships of the United States Navy.  Time to get back to work!!! So, how do you know what version of PowerShell your clients are running.  There are a variety of ways of doing this.  We are going to use a CIM sessions to remotely pull this information from your client machines.  A few things need to be in place first. PowerShell Remoting needs to be turning on. ( http://mctexpert.blogspot.com/2011/03/enable-powershell-v2-remote-management.html ) Give your clients time to update their group policy.  This may take more than a day depending on how your network is laid out. Query the clients from Active Directory that you want to query.  Here is the link to the Remote Server Administrator Tools for Windows 10.  There are similar versions all the way back to Windows 7.  Install this on your client. ( https://www.microsoft....