So I’ve recently had a need to begin using Slack. I started out using a web browser, but since there is a Windows client I decided to give it a go. This article isn’t about Slack as much as what I was curious about and how I decided to tackle the problem. I had read…
Tag: Scripting
What Are You?
Here’s a quick way to tell whether a given machine is real or not: check the Win32_Baseboard class. You can use either Get-WmiObject or Get-CimInstance. Notice the results from a few physical machines. Now see the result when querying a Hyper-V virtual machine: I don’t have any VMware available so I don’t know what kind…
Where Did the Time Go?
Like many of you the work day just seems to fly by. At the end of the day I start wondering what I really got accomplished and what I actually did all day. Well if you are willing to face the truth I have a way to help. Last year I wrote about a PowerShell…
What’s the Weather?
I have used a PowerShell module I wrote a while ago to retrieve weather information from Yahoo.com. Yahoo offers a set of web APIs which are free to use, that will provide weather information for a given location. The location is determined by a “Where On Earth ID”, or woeid. Fortunately, there are APIs to…
PowerShell Summit Europe 2015 Presentations
Last week I gave two presentations at the European edition of the PowerShell Summit held in beautiful Stockholm, Sweden. If you weren’t able to attend, you can still enjoy the sessions because everything was recorded. Session recordings for the entire conference can be found on PowerShell.org’s YouTube channel. I thought I would post something here…
Updated PowerShell Formatting Functions
Last year I posted an article and a set of PowerShell functions to make it easier to format values. For some reason, I decided to revisit the functions and ended up revising and extending them. I modified Format-Value so that you can format a number as a currency or a number. Format-Value help (Image Credit:…
Teeing Up to the Clipboard
Because I spend a great part of my day creating PowerShell related content, I often need to copy command output from a PowerShell session. The quick and dirty solution is to pipe my expression to the Clip.exe command line utility. get-service | where { $_.status -eq ‘running’} | clip This works in both the console…
An Improved Get-Verb Command
A recommended best practice for PowerShell scripting, especially when developing functions, is to follow the standard Verb-Noun naming convention. The Verb should be a value from the list of approved .NET verbs. The easy way to see that list is with the Get-Verb cmdlet. The result will also indicate the verb group or category like…
Friday Fun: Tickle Me PowerShell!
I work at home for myself which means I have to act as my own assistant, reminding me of important events and tasks. And sometimes I need a little help. So why not use PowerShell? In the past I’ve used and written about using a background job to wait until a certain number of minutes…
Measuring Folders with PowerShell One More Time
I know I just posted an update to my Measure-Folder function but I couldn’t help myself and now I have an update to the update. Part of the update came as the result of a comment asking about formatting results to a certain number of decimal places. I typically the Round() method from the Math…
Creating a Hyper-V VM Memory Report
I use Hyper-V to run my lab environment. Since I work at home I don’t have access to a “real” production network so I have to make do with a virtualized environment. Given budgetary constraints I also don’t have a lot of high end hardware with endless amount of RAM and storage. So I often…
Measure that Folder with PowerShell Revisited
Last year I posted a PowerShell function to measure the size of a folder. I recently had a need to use it again, and realized it needed a few tweaks. By default, the original version recursively searched through all subfolders. But there may be situations where you only want to measure the top level folder,…
Simulating a PowerShell Demo
A number of years ago I published my version of a Start-Demo script. In my version, I can create a text file with all of the commands I want to run. It might look like this: Get-Date get-ciminstance win32_logicaldisk | select DeviceID,Size,Freespace :: get-service | where {$_.status -eq ‘running’} | Select Name,Status | Format-Table -autosize…
SQL Database Report Revised
Last year I wrote an article that explained how to use the SQLSERVER PSDrive to create an HTML report highlighting some server and database information. If you want a refresher you can find that article here. In short, you can install the SQL Server PowerShell module on your client desktop and use it to manage…
Friday Fun: A PowerShell Macro
Today’s Friday Fun is a little different in that it showcases two things I use almost every day: Microsoft Word and PowerShell. I am writing new articles and material almost daily and of course very often the content is PowerShell related. Usually I use the blog post template in Word to make it easier to…