Database functions for PowerShell