Hacker News new | ask | show | jobs
by jiggawatts 1237 days ago
The PowerShell commands:

    Import-Xlsx and Export-SQL
They do what they sound like. The first command will run even on Windows Server Core and Linux, and doesn't need Excel installed. It's only slightly slower than the 64-bit C++ compiled MS Excel executable at parsing multi-gigabyte files, which it can do in constant memory (streaming mode).

The purpose of this is to enable spreadsheet-driven bulk provisioning tasks where there are a lot of distinct-but-similar parameters. I added some niceties such as the ability to trim off leading or trailing spaces and blank lines to prevent objects being created with names such as "xyz ".

The Export-SQL is the twin, which dynamically adds missing columns to a table and similarly allows streaming input. Simply pipe anything from the command-line to get it into a database for indexing and querying. This will work as expected:

    Get-AzVM | Export-SQL -TableName 'azurevms' -Database 'Reports'
For general purpose queries over medium amounts of data, nothing really beats the performance of SQL Server on an 8-core laptop with modern SSD and 64 GB of memory.

I planned to open-source and publish both utilities, but there remain a couple of bugs that I could never be bothered to fix, and I'm not comfortable publishing tools that could potentially lose or corrupt data. That could make someone else's day very bad.