OledbSql

1.0.4

A Powershell module that provides a simple means to connect to any OleDB compatible database and execute SQL queries, returning the results as piped objects.


FEATURES

* Tables are returned as System.Management.Automation.PSCustomObject objects, whose type can be specified with the TypeName parameter.
* Scalar results (update, insert, delete, etc) are return
A Powershell module that provides a simple means to connect to any OleDB compatible database and execute SQL queries, returning the results as piped objects.


FEATURES

* Tables are returned as System.Management.Automation.PSCustomObject objects, whose type can be specified with the TypeName parameter.
* Scalar results (update, insert, delete, etc) are returned as an integer value representing the quantity of rows affected.
* The returned objects' parameters are automaticly cast from their datbase types to their .Net equivalents.
* Connection strings can be saved with an alias for ease of use.
* Connection strings can contain parameters that query the user for input. Particularly useful for passwords.
* Duplicate column names are automatically given unique property names.
* Uses OleDb.Net. Though OleDb.net is not as fast as a native provider, it is very flexable. For databases with an OleDB.net provider, the same code will work by appending the correct 'Provider' clause to the connection string. See SQLConnections.txt for examples.


EXAMPLE

   $ConnectionString = 'Provider=sqloledb; Data Source=%Server%; Initial Catalog=%Database%;Integrated Security=SSPI;'
   $ConnectionObject = New-SqlConnection -ConnectionString $ConnectionString
   Invoke-OledbSql -Connection $ConnectionObject -SQL 'select 1 as Ping'

This example creates a connection object, querying the user for the database and server names. It then issues a simple select that returns a '1' if the connection succeeds.
Show more

Minimum PowerShell version

2.0

The owner has unlisted this package. This could mean that the module is deprecated or shouldn't be used anymore.

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Module -Name OledbSql -RequiredVersion 1.0.4

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

Install-PSResource -Name OledbSql -Version 1.0.4

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Copyright

(c) 2020 Nathan Hartley. All rights reserved.

Package Details

Author(s)

  • Nathan Hartley

Tags

sql oledb

Functions

New-OledbConnection Invoke-OledbSql

Dependencies

This module has no dependencies.

Release Notes

Moved project from https://bitbucket.org/treestryder/powershell_module_oledbsql/ to https://github.com/treestryder/powershell_module_oledbsql

FileList

Version History

Version Downloads Last updated