Ever wanted to do a recursive search, but restricted to a certain level of sub-folders? Here is a Get-ChildItem wrapper that let’s you do just that!
(more…)
Category: PowerShell
My PowerShell profile
We all like to customize our PowerShell profile to our own needs, so there is no right or wrong in how to do this, but I’d like to show you mine nonetheless.
(more…)
ConvertTo-DataTable
I have used Chad Millers (@cmille19) Out-DataTable function on numerous occasions. It is used to convert a regular PowerShell object to a DataTable object. It had it quirks though, so I decided to rewrite it to try to fix some of them.
(more…)
New-DataTableFromSqlTable
Working with SqlBulkCopy can sometimes be a struggle. Sure, if you happen to get the data from a table that is identical to the one you want to push to, you are in luck. If not, you need to be sure that the DataTable object is exactly like the target table in the SQL database you want to import data to. One type wrong, or one column in the wrong place, and you are out of luck… it won’t work.
(more…)
Write-PluralString
Ok, this one is perhaps a little silly, but have you ever struggled with writing output involving an integer with an unknown value together with some text? Don’t know what I’m talking about? I don’t blame you!
(more…)
Invoke-CreateModuleHelpFile
Are you a PowerShell toolmaker, and create your own modules? Have you ever wanted to create a help document to distribute together with it? Look no further.
(more…)
List-vmPortGroups
This script takes the name of one or more VMWare host as input and lists all configured port groups.
(more…)
Get-ADObject
This is the first version of a script that uses .NET to query Active Directory. Some limitations apply at the moment, such as a proper filtering system, but that will hopefully be added in future updates.
(more…)
Export-Excel
Here is a script to export object data to an Excel document.
(more…)
Get-DiskInfo
This rather simple script will take one or more, local or remote, computer(s) as input and return an object with disk volume information. Should be easy enough to understand, but I’ll try to add some get-help stuff to it later.
(more…)