Microsoft Windows Server are very great products to work with. And,... server administrators and operators do not like to do stupid work or repeating tasks. That's why I have made this category, to share my most favorite general scripts that I often use. This is not a scripting site, there are many more and better sites available for that. These scripts and tips are just handy for common, migrations and daily use. So, the initially set up was for my own references, but now I share it with you. Enjoy it !! Due to the fact that a big percentage of visitors of this page are international based, this article is in the english language.


Now, there is a large amount of scripts available on the internet, but often,
a certain powershell version is required, depending on the commands etc. etc..
Now how can you determine your installed powershell version in a fast and efficient way?

You can find your version by opening the regular Powershell module an just type Get-Host from the prompt.
How to determine your installed powershell version - www.oostdam.info













Besides the hostname, there is the Powershell version already in the second line, but all the other usefull variables as well. I personally often use the Name, Version, InstanceId and the IsRunspacePushed in scripts, in order to determine which commands should be used in scheduled remote tasks. Besides that, this can be a very handy command if you are working daily in different environments.

Now, just think a little about the extra remote security possibilities this can give you.  As an administrator, you are probably very lazy out of the box.
Using this Hostname and Version variables in remote scripts can help you checking connection, before executing remote scripts.

I personally do not like to allow the running of remote powershell scripts, but these combinations of name, version and InstanceId can certainly help you to double check a remote machine before executing a command. I do not want to reveal the whole statement in this article, but, as you will become a regular powershell user, you will understand this last line within a few months I'll guess.


Have fun, using Microsoft Powershell !

 

-----------------------------------------------------------------------------------------------------

Ben OostdamBen Oostdam has been working with Windows systems since 1993. Worked for several companies as a system administrator, and is currently a Senior Support Engineer for a large company in the Netherlands.

Disclaimer: The information contained in this website/article is for general information purposes only. The information is provided as is, by Ben Oostdam and while we endeavour to keep the information up to date and correct, we make no representations or warranties of any kind, express or implied, about the completeness, accuracy, reliability, suitability or availability with respect to the website or the information, products, services, or related graphics contained on the website for any purpose. Any reliance you place on such information is therefore strictly at your own risk. In no event will we be liable for any loss or damage including without limitation, indirect or consequential loss or damage, or any loss or damage whatsoever arising from loss of data or profits arising out of, or in connection with, the use of this website. Through this website you are sometimes able to link to other websites which are not under my control. I have no control over the nature, content and availability of those sites. The inclusion of any links does not necessarily imply a recommendation or endorse the views expressed within them. Every effort is made to keep the website up and running smoothly. However, I take no responsibility for, and will not be liable for, the website being temporarily unavailable due to technical issues beyond our control. All entries in these articles, are my individual opinion, or from co-writers and they don't necessary reflect the opinion of my employer.



 

Wednesday the 17th, July 2019. All rights reserved.. // Oostdam WebDesign