In this blog post I will explain why to automate installations of Windows applications and how you can do this.
Why automate the installation of applications?
But first, why is this useful? Well this depends on your situation and there are probably many good reasons. For me though, it basically boils down to this:
- I often reinstall my computers with new (preview) versions of Windows operating systems and having to install applications each time is a waste of time. Also sometimes you forget to install some things.
- On a regular basis, friends and family either want me to install or upgrade their PC and I want to provide them with a standard set of programs that most people need/want without having to spend a lot of time on it. By example virus scanner, burning program, media player, codecs, etc.
- I want to update existing installed applications to the latest (and hopefully more secure and feature packed) versions.
- When installing applications, there are often checkboxes enabled to install other applications (you generally don’t want to install). Automated solutions using packages generally prevent these additional unwanted applications from installing.
Which tools to use to automate the installation of applications?
Before PowerShell 5 preview was released, I used both Ninite and Chocolatey to perform to automate installations. They both have their advantages as described on this wiki page.
The PowerShell 5 preview version of OneGet installs and searches software from Chocolatey repositories, but support of additional repositories will come in subsequent versions.
How to automate the installation of applications using PowerShell 5 preview?
To automate the installation of applications a couple of things are required:
- You need to determine which applications you want to install automatically.
- You need to determine the package name that Chocolatey uses for this application. Options include:
-Using a browser to browse the Chocolatey packages
-Using PowerShell and a part of the name of the application you’re looking for. By example if you’re looking for Irfanview, use:
Find-Package -Name “fan”
- Store the package names to install somewhere (e.g. in a .txt file on OneDrive for easy access). My .txt file by example includes:
AdobeReader
Directx
ffdshow
Flashplayerplugin
GoogleChrome
Imgburn
IrfanView
Javaruntime
Keepassx
Mp3tag
mpc-hc
PDFCreator
Silverlight
TeamViewer
Totalcommander
Winrar
greenshot
- Use the Install-Package cmdlet to install all the packages whose name is in the file from step 3.
Install-Package -Name (Get-Content C:\OneDrive\AppsToInstall.txt) -Confirm:$False
- Wait for the programs to install
My opinion
It’s great to be able to use PowerShell to install my list of favorite applications similar to like I did with Chocolatey and I’m also looking forward to see what benefits the additional repositories will bring in the future.
I did encounter some errors however while trying to install some applications like Firefox and dotnet3.5. But since it’s still a preview, this will probably be fixed.
For regular users, I think they are better off sticking to by example Ninite because they’re often afraid of anything that involves a CLI.
Blog posts by other people about OneGet
Some other people have also blogged about the OneGet module and have gone in more technical detail, so be sure to take a look at their posts as well:
More information about PowerShell 5 Preview including a download link
Windows Management Framework v5 preview, includes also Desired State Configuration (DSC) improvements and NetworkSwitch commandlets to manage network switches that pass the Certified for Windows Program. For more information including a download link, you can read the initial blog post. : Windows Management Framework V5 Preview
Like this:
Like Loading...
Tags: application, automate, automation, Chocolatey, CLI, installation, Ninite, Powershell, Script
Last week Mark Minasi presented a webinar made possible by http://www.learnit.com called:
“The Case for PowerShell: Why To Learn-PowerShell So You Needn’t Leave-Industry”.
The recording can be found here.
In this webinar he explains why ICT administrators need to be(come) familiar with PowerShell. He also explains the basic principles of PowerShell to help lower the threshold for people that have been shying away from command line interfaces (CLI) and scripting in the past. He does this by explaining how PowerShell is different from by example the CLI and Visual Basic Scripting (VBS).
I share his opinion about the necessity to learn PowerShell and therefore I hope I can help spread the message.
You can keep track of Mark Minasi by following him at Twitter: https://twitter.com/mminasi (@mminasi).
Like this:
Like Loading...
Tags: automation, CLI, Cloud, ICT, Microsoft, PoSh, Powershell, recording, scipting, Scripting, vb, vbs, video, video recording, visual basic, visual basic scripting, Windows
The last couple of months I’ve been playing around a lot with PowerShell and I’ve also been trying to make some nice GUI versions for my script using PowerShell Studio 2012 from Sapien Technologies Inc. While looking for more information how to best use PowerShell Studio 2012 I came across LazyWinAdmin.
LazyWinAdmin is a great tool created by Francois-Xavier C that will save you a lot of time. It provides you with most of the commonly used tools and commands in a very structured and easy to access way. In the picture below you can see what I mean.

For more info on the tool, take a look at the website and be sure to download and test it yourself.
If you want to take a look at other useful tools I’ve found in the past, take a look at my applications list.
Like this:
Like Loading...
Tags: application, Applications, automation, graphical user interface, gui, Powershell, PowerShell Studio 2012, Sapien, Sapien Technologies, Sapien Technologies Inc., Script, tool, tools
With PowerShell it is relatively easy to reverse a string:
$str = “gnirtsdesrever”
$str[-1..-($str.length)] -join “”
Some of you might ask: Why would anyone want to do this ? Well, since the start of the year Usenet DMCA takedowns have begun to occur automatically, very quickly and very often. This means many movies and TV series on Usenet / News Groups are being taken offline very quickly.
Counter measures to prevent takedowns by uploaders include:
- The use of encrypted links to NZB files.
- The use file names that make it harder to find copyrighted files.
As you can probably guess, some just reverse the file names. The PowerShell script I’ve created will automate reversing the file names for files in the specified folder that match the specified file name filter.
I hope it is useful for you as well.
PS: Someone else on usenet had the same idea as me and created a VBS that will add a right-click menu option to explorer. I’ve added this in the same location as my PowerShell script as well.
Like this:
Like Loading...
Tags: automation, File, File rename, Powershell, Rename, Script, Scripting, Windows
At the companies I’ve worked for , disk space on the system disk ran out on a regular basis for some systems and caused a lot of monitor calls. These kind of boring repetitive tasks are always the ones you want to automate.
So when I came across the great blog post “Weekend Scripter: Use PowerShell to Clean Out Temp Folders” on the “Hey, Scripting Guy! Blog”, I wanted to post it on my own blog as well. The blog post also describes the process of creating the script very well, which is very convenient for those who are relatively new to PowerShell to scripting and want to learn how to do it better.
If you want to take it even a step further, you could automate it even more. By example by automatically running the clean script when an event is generated that the disk is running out of space. You can configure this using by example:
Or you could use PowerShell remoting to do it on many systems at the same time. This could come in handy by example when after WSUS patching the content in “C:\Windows\SoftwareDistribution\Download” is not deleted automatically.
Like this:
Like Loading...
Tags: automation, clean, disk full, disk running out of space, disk space, Event, Powershell, SCOM, Script, Scripting, System Center Configuration Manager, temp, temporary, temporary files
Even though I’ve always liked VMWare vSphere, I thought the events and informational messages weren’t always as helpful as they could be.
One of the common things I want to know are the vmotions and storage vmotions that have taken place. Luc Dekens has created a great script that shows the (s)vmotions that have taken place including details about them.
Be sure to take a look at his website for the PowerShell / PowerCLI script including a detailed explanation:
http://www.lucd.info/2013/03/31/get-the-vmotionsvmotion-history/
Like this:
Like Loading...
Tags: automation, PowerCLI, Powershell, report, Script, Scripting, storage vmotion, svmotion, vmotion, VMware
One of the least favorite tasks of many administrators is to document. Good administrators also don’t want to manually do things when it can be automated. This is where Active Directory Topology Diagrammer (ADTD) can help to automate documenting your Active Directory environment.
Recently I have been working on a new Active Directory OU design and used the Active Directory Topology Diagrammer to create a Visio diagram for the AS-IS situation. I have to say it worked great. Keep in mind though that it will show the OUs and not any other containers.
Besides documenting AD OUs, the Active Directory Topology Diagrammer can document many other things as well. Take a look at the article “How To Use The Active Directory Topology Diagrammer” or play around with it yourself to see what it can do.
The tool can also be very helpful when:
- You’re in a new environment and need to get a quick overview of the Active Directory.
- When there’s no documentation available or when the available documentation is outdated.
- When you’re auditing the quality of documentation.
For more tools, take a look at my website: http://bjornhouben-web.sharepoint.com/Lists/Applications/Summary.aspx
Like this:
Like Loading...
Tags: Active Directory, Active Directory Topology Diagrammer, AD, ADTD, automate, automation, Diagram, document, document active directory, document AD, documentation, Microsoft, tool, Visio, Windows, Windows Server
About 6-7 years ago at school we were taught how to script using VBscript. I was really bad at it though and never really made an effort to change that. When PowerShell became more popular however I had gained some working experience and was also pleasantly surprised by the simplicity of it.
I started learning about PowerShell scripting by googling and using script examples. Disadvantages of this approach however is that:
- You can pick up bad habits from others (without realizing it).
- You sometimes don’t know exactly why you’re doing things a specific way.
- You sometimes don’t know why some things are/aren’t working.
PowerShell is getting increasingly important though:
- Even though more companies are offshoring and employees are relatively, it is still cheaper to automate instead.
- Cost isn’t the only issue, speed is important as well. Scripting allows you to get things done more quickly.
- PowerShell is increasingly being adopted by more companies, products and (cloud) services.
- The number of available built-in cmdlets are increasing, which makes it even easier to automate actions.
- For many products you have to use PowerShell to make specific settings, because only the more basic settings are available in a Graphical User Interface (GUI).
- Changes can be applied consistently in a development, test, acceptance, pre-production, production environment.
- Less chance of human error.
- If done correctly, you’ll also have included a way to quickly revert the changes by script.
To make sure I didn’t miss out on too many things, I decided to start with a book that teaches the basics. Because of the good reputation of the authors Don Jones and Jefferey D. Hicks in the PowerShell community, I decided to go for their book “Learn Windows PowerShell 3 in a month of lunches, second edition” published by Manning Publications Co.
The book’s purposely didn’t try to stuff all PowerShell related information into the book. Instead it provided the reader/student with the basics needed to be able to find/discover this information themselves if needed. I personally like this approach, because otherwise there would be too much information to take in which might be demotivating and distracting.
I also liked the practical examples of common mistakes made by people who are new to PowerShell. There were a lot of examples I ran into as well when I started using PowerShell and I think this will prevent people from becoming frustrated because they understand why things aren’t working the way they might have expected.
All in all this is a great book to start learning PowerShell. This is however just the start and you should expect to continue using other resources/books to further your knowledge. The book also provides links to useful resources as well. And most importantly … start using PowerShell more so you will learn by experience.
Personally I still have these books lying around, but haven’t decided yet which one to start with next:
I’m also still considering taking a PowerShell course, but I’m a bit hesitant about the added value because it’s hard to determine the quality of a course by the description.
If you have experiences or suggestions, please let me know.
Like this:
Like Loading...
Tags: automate, automation, Don Jones, Jefferey D. Hicks, learn, Learn PowerShell toolmaking in a month of lunches, offshore, Powershell, Scripting, Windows PowerShell
I run Winaudit on each server/system and save it to a central location named <computername>.csv This way I have access to a lot of information about each system. If you need a specific subset of information for each system however, you don’t want to have to open each file manually to get this information.
This script will parse each <computername>.csv to extract specifc information and save it to one new file containing this info for all parsed separate files.
Like this:
Like Loading...
Tags: Audit, automate, automation, csv, Microsoft, Parse, Powershell, Script, system, System Info, System information, WinAudit
In a previous blog post I’ve already shown this script that use PowerCLI to get the percentage of physical and virtual servers from your VMware environment for each Virtual Center server. This script however only took into account ESX hosts and VM’s in each Virtual Center server separately.
This means that:
- The UCS blades weren’t taken into account as physical servers.
- No percentage was being calculated for each physical location.
This new script automates determining for each location the number of physical and virtual servers in VMware vSphere and Cisco UCS.
PS: You can get more detailed information from the script, but it has been disabled using comments by default.
Like this:
Like Loading...
Tags: automation, Cisco, Cisco UCS, Cisco Unified Communication System, corporate social responsibility, CSR, Green IT, Microsoft, PowerCLI, Powershell, Script, Scripting, UCS, virtual center, virtual infrastructure, virtualcenter, virtualisation, virtualization, VMware, VMware vSphere, vSphere, Windows