The daily overkill?

I still have not decided, is it really overkill or just very nice? Or is it not solving the issue at all or is actually quite useful? I got a mail from an internal mailing list about getting some quick feedback on code that was written to retrieve disk free space from a single or several machines. The actual question was somewhat directed towards a one-liner, but why would I write something that is not reusable? So while not exactly an answer to the question, but using some simple tricks I think the script itself is pretty nice and actually uses some intelligence to retrieve information, fixing some stuff with objects etc. Ah well, just enjoy and use if you can! It retrieves the disk free space in GB and in %.

 

C2RUtilities.psm – Click to run help in PowerShell

Here is a quick utility module for PowerShell I threw together to make some task regarding C2R (Click To Run) deployment of Microsoft Office Pro Plus easier. The module have no external dependencies but a bit rough around the edges and is adapted very much for a couple of tasks at hand. This is as usual my own work and is not supported by Microsoft and I leave no guarantees what so ever.

Get-C2RSetupFile
Downloads the latest version of Setup.exe. It downloads the installer, unpacks the Setup.exe file and then throws everything that is not needed away. Clean and easy way of making sure that Setup.exe always is up-to-date.

Get-C2RDistributableFiles
Downloads all the files for C2R Office Pro Plus, as according to configurations, one or multiple. This is primarily to populate a local distribution point first time around. It supports multi-version and multi-language.

Save-C2RMultiConfig
Saves a bunch of config files at the same time. Used when bulk-creating multiple version or multiple shares for local distribution points.

New-C2RConfigXml
Creates a configuration file for used by the out-of-the-box installer Setup.exe that you downloaded earlier. Supports most common options of adding, removing and languages. Should be pretty straight forward to use.

Get-C2RVersion
This will download and parse the list of available builds on the CDN. This is useful for when populating a local distribution share.

Example
The following example will download a list of all available versions in the CDN, create deployment config in Swedish, German and US English using standard options but with a local update path, save the deployment configs to the share for use later when deploying and lastly actually download all the bits.

 

PowerShell Library and PowerExe Builder updated (again!)

This evening the PowerShell Library was updated to version 5.2.5.0. Use Update-SPELComponents to update, then restart PowerShell.

  • Added support for icons for PowerExe Builder and changed infrastructure for SelfHostedPS Icons to handle raw images instead of temp files.
  • Removed support for commandline arguments as introduced in 5.1.0.0 (manually specifying arguments, manifested as variables inside the running application)
  • Added support for standard parameter sections: PARAM.  It supports all data type attributes for all .net built in primitives, mandatory parameter setting, and the parameter name and help message attributes. It will however try honoring all unkown data types but will warn when building if not supported and it might not work.

Also, PowerExe Builder, have been updated (to 1.1.0.0) to reflect the above changes. This can be most noted in that the parameter setup windows have been removed as this magic now is done in the background by the library at runtime and no manual intervention is needed. Also two minor cosmetic bug fixes have been implemented.

PowerExeBuilder_1.1.0.0

 

Announcing PowerExe Builder

Today I have the great pleasure of announcing a stand-alone version of the SelfHostedPS parts of my PowerShell Library. It has a nice GUI and everything you need to produce simple EXE files from PowerShell scripts. Some features are not yet supported if you compare the two edition but as this basically lives on-top of the PowerShell Library features will be added moving ahead, and some unique features such as automatic parameter mapping will be added in future versions.

PowerExeBuilder

Version 1.0.0.0 released here.

An golden oldie – RunAsEx

They say statistics never lie. Until last year when I brought the download down, some 25.000 downloads had been recorded for the RunAsEx utility I had written. I also get a couple of emails every month asking me to release the RunAsEx source or binary. I have for a long time refused as I do not think it adheres to any good security practices. However I do recognize that sometimes you need a quick and easy replacement that does that little extra thing. So once again it is now online for download, and this time I have released the source also! The tool was originally published back in 2011 and the code is basically the same today but I had to re-sign it with my new code signing certificate as it was signed with an very old key. Uses .NET 2.0 framework. Enjoy!

Read more about Sorlov.UserExec (RunAsEx)

Sorlov.PowerShell rebranding and re-launch

Today I have the pleasure of releasing Generation 5 of my library Sorlov.Powershell, now rebranded to SPEL (Sorlov Powershell Extension Library). Many internal components have been revamped. Integration and need for third party components have all but some been removed and the library now do not contain functionality found in stock PowerShell as the PowerShell evolution have been moving forward.

The major functionality is still self-hosted PowerShell exe-files, services, and not to mention the support for HTA-based PowerShell scripts.

This new version also breaks updating since a new model is in place; it still supports the same configuration files but you need to manually remove the old
version to install the new version (ie delete all binaries under \WindowsPowerShell\Modules\Sorlov.PowerShell or where you have installed it) and then run the installer.

Read more and download from the SPEL information page.

Holliday fun

This is a very silly and stupid demo of the Import-HTML and Out-Word Cmdlets that are both parts of the PowerShell library I publish. I was inspired to this module (apk.psm1) by fellow MVP Niklas Goude who once made a script to pull these values down with PowerShell. However I needed very fast parsing of HTML to XML and the Internet Explorer parser is simply to slow for me and so I wrote the Import-HTML wrapper around some code from the HtmlAgilityPack.

So what do the script do you wonder? Well The script will go to APK.NU (Alcohol Per Krona Index) and get the list of the best prices for alcohol in the Swedish monopoly (this is the childish part of the script) as HTML. Take it for what it is: a demo of parsing HTML and I needed some arbitary data to parse.. =) After download completes then it parses the document to xml then we are able to use those values to create a nice pdf or whatelse we need.