Get all (non-default) scheduled tasks

I tried querying the scheduled tasks to give me a list of all (non-default) scheduled tasks. I also wanted to have its schedule information, which appeared to be a pretty hard task in the get-service command. After several unsuccessful attempts, I tried something else with great and immediate results. It appeared that the schtasks did … Continue reading Get all (non-default) scheduled tasks

Get all non-default Windows services

Getting a list of all services isn't that hard. This can be achieved with Get-Service or with Get-WmiObject win32_service. It seems that Get-Service doesn't leave me with enough properties to query and/or filter out, and this time the Get-WmiObject queries work quick enough; thus I'll use this for my code. I wanted a list of all … Continue reading Get all non-default Windows services

Add-WindowsFeature Error: 0x800f0902 – The operation cannot be completed because Windows is currently performing another servicing operation

Today I encountered a problem, for which I couldn't find a solution (which is pretty rare), so thought I'd post a blog about it and maybe someone can help me. I sometimes have a problem with the Add-WindowsFeature. In powershell, overall it works fine, but sometimes it gives me the following error: Add-WindowsFeature: The request … Continue reading Add-WindowsFeature Error: 0x800f0902 – The operation cannot be completed because Windows is currently performing another servicing operation

Creating an ODBC connection

With Powershell 4 on Windows 8 and 2012, they've improve the support for ODBC connections. You just need to import the Wdac module to be able to use the different ODBC functions. Get-Command *ODBC* shows the following functions: Add-OdbcDsn Disable-OdbcPerfCounter Enable-OdbcPerfCounter Get-OdbcDriver Get-OdbcDsn Get-OdbcPerfCounter Remove-OdbcDsn Set-OdbcDriver Set-OdbcDsn For instance, if you were to create a … Continue reading Creating an ODBC connection

Quick command to open explorer from the current directory in Powershell

Here is a quick command if you want to open Windows Explorer from the current directory in Powershell: ii . (note the space between the 'i' and the dot) ii is powershell's alias for invoke-item. Adding a dot to that command will open the current directory using the default explorer. Edit: If you'd like to … Continue reading Quick command to open explorer from the current directory in Powershell

Run a powershell script if the computer contains the correct powershell version

Several times I encountered that a computer I was running my scipt on, didn't support a certain parameter or a certain command because it didn't have Powershell 4 installed. Thus I thought it would be time to create a default error-handling for each of my scripts which checks if the computer runs the correct Powershell … Continue reading Run a powershell script if the computer contains the correct powershell version