Tag Archives: GitHub

Virtual PowerShell Presentation Microsoft User Groups Singapore

Last Friday I presented at the PowerShell Meetup of the Microsoft User Groups based in Singapore. Having been a speakers at the PowerShell Conference Asia, which is also held in Singapore, for the past two years, it was nice to virtually be present in the Microsoft offices again. 

The session I prepared was on the topic of writing PowerShell code, what tools to use and how to leverage the strengths of those tools. I focused the presentation on using both Visual Studio Code, VSCode, and the PowerShell ISE in combination with ISESteroids.

I have uploaded all the materials I used during my presentation to my Events GitHub Repository, which is available here:

GitHub – Jaap Brasser – Events – MSUG Singapore

To get an impression of the event, the event organizer Sebastian Szumigalski was kind enough to provide me with these pictures of the event, be sure to check out his blog it contains a lot of great content. Here are some of the photos to give you an impression of the event.

The PowerPoint slides are also available on SlideShare:

Dutch PowerShell User Group – 10th Edition

Last Thursday we hosted the tenth Dutch PowerShell User Group at Rabobank in Utrecht. It was another full day event starting at 9AM and finishing at 6PM. For this event, we had a diverse range of speakers and as a highlight we had Jakub Jareš visit our user group and giving two presentations on proper testing with Pester and Continuous Deployment for PowerShell.

Due to the enthusiasm of Ben van Zanten, Bartek Bielawski and Daniel Both we had three surprise speakers that added to our already full day of session. Our complete program of the day consisted of the following:

BEGIN END SPEAKER TITLE
09:00 10:00 Jakub Jareš Continuous deployment pipeline for PowerShell modules
10:00 11:00 André Kamman Fighting SQL Server Configuration Drift with Dynamic Pester Tests
13:00 14:00 Jakub Jareš Biggest mistakes when testing with Pester
14:00 15:00 Ralph Eckhard & Sven van Rijen Keep up with NOW! Automate (re-)building your homelab – on steroids!
15:00 16:00 Ben van Zanten Splatting and building new AD forests
16:00 17:00 Jaap Brasser The best tool for the job: Working with VScode and ISE
17:00 17:30 Bartek Bielawski & Daniel Both Distributed configuration management and source control

I have uploaded all the materials I used during my presentation to my Events GitHub Repository, which is available here:

GitHub – Jaap Brasser – Events – DuPSUG 10

For the Dutch PowerShell User Group we maintain a separate repository which we keep updated with all presentation materials as they are made available by our presenters, this is available here:

GitHub – DuPSUG – DuPSUG 10

We would like to extend our thanks to our event sponsor, Rabobank for sponsoring us. The speakers and attendees alike for taking time out of their busy schedules to attend our meeting. To give you an impression of the event here are some pictures of the day:

 

9th DuPSUG Meeting – Ninth time is the charm

The 9th Dutch PowerShell User Group meeting, almost exactly four years after our very first meeting. First of all I would like to thank everyone involved, speakers, IPsoft and our attendees for making this event into a success. We announced this event just 6 days before it was actually held and we were at full capacity within two days. A great show of community involvement which was definitely present during the evening.

During the event we had the following  three speakers and sessions:

Speaker Session
Aleksandar Nikolić Just Enough Administration (JEA), a New Solution for Delegated Administration
Flynn Bundy Getting started with Windows Server Containers
Jaap Brasser Read the Friendly PowerShell Logs

The event was hosted and generously sponsored by IPsoft and the following photos will give you an impression of the event:

We have also created a separate repository on the DuPSUG GitHub account which has all available presentations:

9TH DUPSUG MEETING

During the evening Thierry Cailleau once provided us with live reports of the content being presented including notes and links in our Slack channel, dupsug.slack.com. Feel free to join us there to catch up on the details of the evening.

We hope to see you again in the next year as we have many more events planned in 2017!

Recap of Dutch PowerShell Saturday September 2016

Last weekend we gathered for yet another PowerShell Saturday, this time hosted in Amsterdam by IPsoft who generously provided us with the space to hold our meeting. This was the second time we organized the PowerShell Saturday event and it was nice to see that once again we had a great turnout. Not the least because of the great line up of speakers, during the event we had the following four speakers:

Speaker Session
Flynn Bundy Nano Server – The Future is Now
Javy de Koning Optimizing code for collaboration
Matthew Hodgkins Chatops with PowerShell
Irwin Strachan OVF – Pester for SysAdmins

During the event we took a number of pictures to give you an impression of event:

During the event Thierry Cailleau provided us with live reports of the content being presented including notes and links in our Slack channel, dupsug.slack.com. Feel free to join us there to catch up on the details of the day or if you have any questions regarding the content that was shared during PowerShell Saturday.

After a full morning and afternoon of presentations we continued on with the Open Stage, this is the section of the PowerShell Saturday where we will have room for several short presentations, the opportunity to share something interesting you have found out when working with PowerShell and a moment to discuss common issues. In which both me and Flynn shared some ideas on Docker and exporting PowerShell objects as binary streams.

For the full list of materials shared during the event and the open stage please refer to this overview of links:

Links in this article
Flynn Bundy DevBlog
Javy de Koning – Optimizing code for collaboration
Matthew Hodgkins – ChatOps presentation
Matthew Hodgkins – Hubot DSC Resource / PSHubotDocker
ChatOps – Managing Operations in Group Chat
Irwin Strachan – OVF – Pester for SysAdmins
Dutch PowerShell User Group – DuPSUG

 

250000 Downloads in Technet Script Gallery

Jaap Brasser - TechNet Script GalleryApproximately one year ago I saw the number of downloads tick over a hundred thousand, today my total downloads from the TechNet Script Gallery has reached 250,000.  To celebrate this milestone I have uploaded all of the scripts I have stored in the TechNet Script Gallery also to GitHub to simplify the updating and collaboration with others.

My personal preferred method of installing and sharing scripts is by using the PowerShell Gallery, which is available at PowerShellGallery.com or by using the PowerShellGet cmdlets, for example the following two lines of code can find the scripts and modules I have currently posted:

1
$(Find-Script;Find-Module).Where{$_.Author -match 'Jaap Brasser'}

FindModuleandScripts

The complete list of my scripts is now available on GitHub:
Jaap Brasser – GitHub – SharedScripts
Jaap Brasser - GitHub - SharedScripts

And also in the TechNet Script Gallery:
Jaap Brasser – TechNet Script Gallery

As I personally mostly see benefit in sharing of modules and not so much single scripts and function I am working on converting some of the scripts I have written into modules and once they are finalized I will upload those to the PowerShell Gallery as well. So my question to the community is as follows, which improvements are you most interested in or what would you like to see next?

Feel free to use the comment section underneath this post to share your ideas or feedback. That is it for now, until the next milestone!

250,000 Downloads
My TechNet Community Profile
My entries in TechNet Script Gallery
Jaap Brasser – GitHub Profile
Jaap Brasser – PowerShell Gallery

DiskCleanup – Remove Previous Windows Versions – PowerShell Module

Over the last few weeks I have upgraded and reinstalled a number of Windows 10 machines and as part of my routine after an upgrade to a later build of Windows 10 I would clean up both the Upgrade files as well as the old version of Windows. The steps to do this involves starting the Disk Cleanup tool, with Administrative credentials, and clicking through the interface in order to clean up the files and save up some of those precious GBs of storage space. After repeating this process a few times in the past week it started to become a bit tedious.

In order to do this is use the command line options that are available with the Disk Cleanup tool, cleanmgr.exe. While it is unfortunately not possible to use this tool directly to clean up specifically the left over files of an Upgrade of Windows 10, it does allow for using the GUI to create a ‘StateFlags’ which is stored in the registry. Using this methodology in combination with Sysinternals Procmon I established where this information was written in the registry and I came up with the following three lines of PowerShell code that allowed me to create the job required to do this job:

1
2
3
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Temporary Setup Files' -PropertyType 'DWORD' -Force -Name 'StateFlags1337' -Value 0x2
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Previous Installations' -PropertyType 'DWORD' -Force -Name 'StateFlags1337' -Value 0x2
cleanmgr.exe /SAGERUN:1337

This will code will first create two registry keys and after creating those registry keys, specify the Disk Cleanup application to run with job number 1337. This worked, although unfortunately it is not possible to hide the GUI completely as user interaction might still be required. In certain scenarios you will be prompted to confirm that you really do want to delete the Old Windows Installation files, that includes the warning that deleting those files will not allow you to roll back to an older version of Windows anymore. This also includes the files if you upgrades from Windows 7/8.1 to Windows 10.

As I saw more potential for this method of utilizing the Disk Cleanup tool, I decided to write a proper module that does simplifies the job creation process beyond just cleaning up Previous Windows Installation / Upgrade files. Today I have released the module that does contains the following functions:

  • Get-VolumeCachesKey
  • Get-VolumeCachesStateFlags
  • Remove-WindowsUpgradeFiles
  • Set-VolumeCachesStateFlags

To install the module on your system you can run the following code:

1
Install-Module DiskCleanup -Verbose

InstallModuleDiskCleanup

To remove  the Previous Windows Installation / Upgrade files run the following command:

1
Remove-WindowsUpgradeFiles -Verbose -Confirm:$false

RemoveUpgradeFiles

This will both create the job with number 1337 and then execute that job, and the Disk Cleanup Windows will appear on your screen. This process can take a few minutes depending on the speed of your system. The function will wait until all Disk Cleanup windows have been closed and then show a report of the amount of space saved.
DiskCleanup

Use the Get-VolumeCachesStateFlags cmdlet it is possible to view what settings have been configured:
Get-VolumeCachesStateFlags

It is also possible to setup a custom job using the Set-VolumeCachesStateFlags cmdlet, the mandatory parameter -StateFlags will accept any number of Switch parameters. These parameters are dynamically generated based on the available Keys in the registry path:

HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Temporary Setup Files

SetVolumeCachesStateFlags

The module is available at the following online repositories:

I will actively maintain this module, so feel free to leave a comment or feature request in the comments or send in a pull request on GitHub.

All the links mentioned in this article are available below:

Links in this Article
PowerShell Gallery – DiskCleanup
TechNet Script Gallery – DiskCleanup
GitHub – JaapBrasser – DiskCleanup
Sysinternals – Process Monitor

 

Uploaded CustomizeWindows10 Module to PowerShell Gallery

Today I finished another major update to the CustomizeWindows10 module I have been working on together with Jan Egil Ring. This module started as a means for me to configure/tweak Windows 10. When I was experimenting with the various Windows 10 insider builds I found myself configuring the same settings on each deployment and I was looking to simplify this process. The module contains a number of tweaks and configuration options to customize and personalize the Windows 10 experience.

CustomizeWindows10-0.0.0.4

In the past I have uploaded the majority of my scripts and functions to the TechNet Script Gallery, but recently I have started using GitHub as a version control system for my scripts. Eventually I plan to upload my entire collection of scripts to GitHub as it provides the opportunity for easier interaction with a wider community but for now this module is my first experiment with both the PowerShell Gallery as well as GitHub.

The module consists of both a PowerShell module as well as a DSC module to allow complete flexibility when applying these settings. In the following example the module will be used to ensure that hidden files are visible and that file extensions are always shown:

1
2
3
4
Import-Module -Name CustomizeWindows10
Enable-ShowFileExtension
Enable-ShowHiddenFiles
Get-ShowHiddenFiles

CustomizeWindows10-CodeExample

For more information or the direct download links of these scripts please refer to the links below. Feel free to leave a comment either here or to contribute directly on GitHub.

TechNet Script Gallery
My entries in TechNet Script Gallery
Blog.PowerShell.No – Jan Egil Ring
JaapBrasser.com – Scripts
GitHub – CustomizeWindows10
PowerShellGallery – CustomizeWindows10
TechNet Script Gallery – CustomizeWindows10