# encoding: ascii
# api: powershell
# title: PowerOracle
# description: Retrieve data from an Oracle database into a dataset.
# version: 0.1
# author: dfafadfds
# license: CC0
# x-poshcode-id: 6666
# x-archived: 2017-01-10T16:40:16
# x-published: 2017-01-04T15:47:00
#
# Prerequisite: Install the Oracle Data Provider for .NET > Google it! =)
#
# Load assembly
[System.Reflection.Assembly]::LoadWithPartialName("Oracle.DataAccess")
# Connection information
$ConnectionString = "Data Source=your_server/sid;User Id=user_name;Password=password"
#Standard SQL Query Syntax
$QueryString = "SELECT * FROM table_name WHERE #Case"
$OracleConnection = New-Object Oracle.DataAccess.Client.OracleConnection($ConnectionString)
$dtSet = New-Object System.Data.DataSet
$OracleAdapter = New-Object Oracle.DataAccess.Client.OracleDataAdapter($QueryString, $OracleConnection)
[void]$OracleAdapter.Fill($dtSet)