Lots of people do. If you look on our Resources menu, under ebooks, the Trend Reports book has some concise sample code that shows how. It's meant for SQL Server, but connecting to another brand is almost identical.
For Oracle, keep in mind you will probably need to install the Oracle client to have the correct ODBC drivers installed. If it's a 64-bit system, keep in mind you will need the appropriate drivers installed. ODBC drivers are separated as 32 and 64 bit, so if you use 64 bit Powershell, you will need 64-bit ODBC drivers installed. I typically install the drivers first and then look at how to build the connection string for the installed ODBC driver.