Skip to content

Instantly share code, notes, and snippets.

@RamblingCookieMonster
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RamblingCookieMonster/4b86f958c41b50f74e66 to your computer and use it in GitHub Desktop.
Save RamblingCookieMonster/4b86f958c41b50f74e66 to your computer and use it in GitHub Desktop.
zSQLite.InsertSelect.ps1
# Insert some data, use parameters for the fullname and birthdate
$query = "INSERT INTO NAMES (Fullname, Surname, Givenname, Birthdate)
VALUES (@full, 'Cookie', 'Monster', @BD)"
Invoke-SqliteQuery -DataSource $Database -Query $query -SqlParameters @{
full = "Cookie Monster"
BD = (get-date).addyears(-3)
}
# Check to see if we inserted the data:
Invoke-SqliteQuery -DataSource $Database -Query "SELECT * FROM NAMES"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment