netnerds.net
Home
AI Integration Series
AI Usage
About
Subscribe
github bluesky youtube github-star rss
  • Using .NET DataTable Computes and Column Expressions in PowerShell

    calendar Feb 3, 2015 · 5 min read  ·
    Share on: facebook linkedin bluesky copy

    As a SQL Server DBA, I'm used to SQL being able to perform aliasing, super fast subselects, and easy aggregation. My most recent project, Invoke-Locate.ps1, however, uses SQLite because of its portability and speed when performing simple selects and inserts. The downside is that SQLite doesn't handle some subselects …


    Read More
  • Working with Basic .NET DataSets and DataTables in PowerShell

    calendar Feb 1, 2015 · 3 min read  ·
    Share on: facebook linkedin bluesky copy

    This is mostly for my reference, but you can use it, too :) Create Basic Datatable 1$dt = New-Object System.Data.Datatable 2[void]$dt.Columns.Add("First") 3[void]$dt.Columns.Add("Second") 4[void]$dt.Columns.Add("Third") 5 6# Add a row manually …


    Read More
  • Find Duplicates in PowerShell Datatable using LINQ

    calendar Jan 21, 2015  · Updated: November 1, 2025 · 3 min read  ·
    Share on: facebook linkedin bluesky copy

    Update 1/4: Removed conversion of datatable to list. That just wasted memory, as this works on all enumerables. I don't have a practical application for this method, but I wanted to figure out how to do it anyway. Doing so was frustrating but kinda fun. It forced me to learn about lamdas in PowerShell which I'll …


    Read More
  • High-Performance Techniques for Importing CSV to SQL Server using PowerShell

    calendar Jan 18, 2015  · Updated: November 2, 2025 · 10 min read  ·
    Share on: facebook linkedin bluesky copy

    If you've ever tried to use PowerShell's Import-CSV with large files, you know that it can exhaust all of your RAM. Previously, I created a script on ScriptCenter that used an alternative technique to import large CSV files, and even imported them into SQL Server at a rate of 1.7 million rows a minute. I've now gotten …


    Read More
  • Quickly Find Duplicates in Large CSV Files using PowerShell

    calendar Jan 16, 2015  · Updated: November 2, 2025 · 6 min read  ·
    Share on: facebook linkedin bluesky copy

    Update 1/18/2015: This native PowerShell script can process over 165,000 rows a second. I'm so pumped. My million row CSV with 9k dupes processed in 6.4 seconds. I actually tried this using LINQ in PowerShell, but it seemed exponetially slower as the dataset grew. A user on reddit's PowerShell subreddit asked for the …


    Read More
  • Professional PowerShell-based SQL Server SMO Recipes

    calendar Jan 8, 2015  · Updated: November 1, 2025 · 2 min read  ·
    Share on: facebook linkedin bluesky copy

    Last year, I finally started working with SMO (SQL Management Objects) within PowerShell and I absolutely love it. Below are a few recipes that I created and use extensively throughout my SQL Management scripts on ScriptCenter. Some recipes show more than one way to perform a task. These SMO recipes are particularly …


    Read More
  • Enumerate file structure within detached MDF database file using SMO

    calendar Jan 7, 2015  · Updated: November 1, 2025 · 2 min read  ·
    Share on: facebook linkedin bluesky copy

    While researching how connect to a detached MDF and read the internal file structure of the internal files, including LDF files, I kept seeing suggestions for using the undocumented DBCC command DBCC checkprimaryfile. Initially, my code looked like this: 1# SQL Server is required to read the file contents 2$servername …


    Read More
  • Create Scheduled Task or Scheduled Job to Indefinitely Run a PowerShell Script Every 5 Minutes

    calendar Jan 5, 2015  · Updated: November 1, 2025 · 3 min read  ·
    Share on: facebook linkedin bluesky copy

    Here are two straight-forward ways to create Scheduled Tasks within Windows using PowerShell. One script creates a PowerShell Scheduled Job, and the other creates a classic Windows Scheduled Task. You can read about the differences here. PowerShell v3 and above required. Create a Scheduled Job The following script …


    Read More
  • Workaround for SMO Bug: urn could not be resolved at level OleDbProviderSetting

    calendar Jan 3, 2015 · 1 min read  ·
    Share on: facebook linkedin bluesky copy

    Microsoft ConnectM isn't letting me sign in to post this workaround, but I just ran into a bug with the OleDbProviderSettings within SMO. To get around it, I used $server.Settings.OleDbProviderSettings instead of $server.OleDbProviderSettings 1$server.Settings.OleDbProviderSettings.Name.Contains("SQLOLEDB") …


    Read More
  • About Invoke-Locate, a PowerShell port of GNU findutils' locate and updatedb.

    calendar Dec 1, 2014  · Updated: November 1, 2025 · 5 min read  ·
    Share on: facebook linkedin bluesky copy

    Tonight, I published Invoke-Locate.ps1 to ScriptCenter because I was tired of mounting my Windows drive to my Linux servers to quickly and reliably find files. Originally, it was going to be a small script, but then I decided to trick it out, add an installer and automatic Task Scheduling to run updatedb. The installer …


    Read More
    • ««
    • «
    • 7
    • 8
    • 9
    • 10
    • 11
    • »
    • »»

Chrissy LeMaire

SQL & PowerShell MVP. GitHub Star. Creator of dbatools. Need to oil my knees.

GenAI book

Buy now at manning.com for 45% off with code gaipbl45

AI Integration Series

  • Automation with AI Toolkit + GH Models
  • Getting Started with AI for PowerShell
  • Asking Tiny Questions: Local LLMs
  • Local Models Demystified
  • Asking Bigger Questions: Remote LLMs
  • PDF Text to SQL Data with OpenAI
  • Document Classification in SharePoint
  • Azure Functions Doc Parser

dbatools book

Now available in bookstores and amazon 🥳 Buy it at manning.com for 50% off with code bldbatools50

dbatools

dbatools is an awesome PowerShell module that helps you migrate entire instances with a single command, plus a whole lot more.

available from dbatools.io and github

dbachecks

dbachecks validates SQL Server environments using crowdsourced DBA checklists and outputs to Power BI and is available on github.com 📊

Find me

Find me on Bluesky

recent posts

  • Got a ChatGPT Subscription? Use It to Keep Your Blog Up-to-date
  • Update your blog with an AI CLI (No, really)
  • Update Your Blog with GitHub Copilot CLI
  • Rebuilding dbatools.io: From Notepad++ to Cursor
  • Have You Considered Not Using SQL Server High Availability?
  • PowerShell Output Redirection with AI CLIs
  • dbatools is moving to Azure Trusted Signing
  • Document Intelligence with Azure Functions: A Practical Implementation

categories

powershell 134 sql-server 124 general 62 security 61 windows 47 sharepoint 42 active-directory 37 linux 31 vbscript 31 networking 30 apple 24 virtualization 22 iis 19 genai 18 github 10
All Categories
active-directory37 ai6 apache7 apple24 asp-net2 azure5 azure-functions1 bi4 db24 dbatools1 devcontainers1 exchange7 genai18 general62 github10 iis19 linux31 livestreaming4 lync2 mastodon4 networking30 oracle1 powershell134 security61 sharepoint42 sql-server124 typescript1 vbscript31 virtualization22 windows47 wpf7
[A~Z][0~9]

Copyright 2003 -  Chrissy LeMaire. All Rights Reserved

Go work on your website

Start typing to search

Search across posts, pages, and commands

    ↑↓ to navigate ↵ to select esc to close
    Powered by Fuse.js