Posts

Showing posts from November, 2023

"The handle is invalid." error in PowerShell ISE

If you're testing scripts using PowerShell ISE and writing events, be careful as you might see this error even though it works pasting the code in PowerShell or executing the .ps1 file: The handle is invalid. (Exception from HRESULT: 0x80070006 (E_HANDLE)) Don't know what causes it but it can be ignored.

Import data with SQL DTS package

Need to actually run through this and update notes. When I was testing my Commvault mp I had to constantly refresh data from a prod SQL table to my test SQL table. This is laborious and can be streamlined a bit using SQL DTS package. To create the DTS package just follow the wizard. I then created a file in C:\temp called _dummy_jobs.csv. Run this to import (update filename/path as needed). dtexec /F d:\mp\Anthony\DTS1.dtsx

Milk bread

Makes 1 loaf (big tin). Takes 1 day. It can be scaled. There is definitely a place for this loaf. It's in between Jack's white loaf and tangzhong, it's perfect if you want soft but not super soft. Ingredients 96 gm water 304 gm milk 8 gm yeast 512 gm flour 10 gm salt 38 gm butter Method Room temp butter (1 hour). Add flour, yeast and salt to bowl. Combine water and milk and warm to 35 C, add to bowl. Do squishy-squishy  10 mins. Add butter. Do squishy-squishy 5 mins. Do table slap 5 mins. Shape into ball and put back in bowl. Dough temp should be 25 C. Ferment until doubled (~2 hours). If cold put in oven with hot tray water. Do finger test. It shouldn't deflate. Flour bench, divide into 3 or 4 and roll into  loose  balls (don't flatten first) and rest 30 mins. Flour bench, rolling pin into usual pre-shape (oval, 2 folds). Rest 30 mins. Rolling pin again and  loosely  roll into loaf. Grease tin and add loaf. Ferment until dough nearly at top of pan (~2 hours). If c

Import csv into Cmdb

This article explains how to add records to a SQL table. Use this method whenever you need to do bulk updates. Steps Backup the  SCOMCmdb.dbo.Configuration table to a csv file Add new records to a csv file Import the csv file into the  SCOMCmdb.dbo.Configuration  table. WARNING: This will delete all existing data in the table. See error below before continuing. Backup data This can be done with a wizard in SSMS but it's quicker running a query. Run this query  select * from SCOMCmdb.dbo.Configuration order by class, name Right-click anywhere in the results and click Save Results As... and save it as a csv file. Add new records to csv file To avoid weirdness during the import, add the headers in if they are missing. Open the csv file in Excel and append new records to the end. Add any other info you want to the columns then save it.  You don't need headers. Import data In SSMS, right-click the  SCOMCmdb database and select  Tasks > Import Data... Select Flat File Source and s