Powershell – Error – “Error formatting a string: Input string was not in a correct format..”

Background Here is another Powershell error message I received this morning. Error Error Image Code Code - Error Code - Correction Outline The issue is that our connection string contains control characters Database Connection String Original :- Driver={SQL Server};Server={0};Database={1};APP={2}" Revised :- Driver={{SQL Server}};Server={0};Database={1};APP={2}" We escaped { by repeating it Same for }, we escaped by … Continue reading Powershell – Error – “Error formatting a string: Input string was not in a correct format..”

Powershell – Error – InvalidCastFromStringToInteger – “Input string was not in a correct format.”

Background Wanted to quickly document an error message I received earlier today working on a little Powershell script. Error Error Image Error Message Code Code - Error Code - Correction Outline The issue is with trying to divide within the format statement To correct Place parentheses around the arithmetic operation $ts.Milliseconds / 10 becomes ( … Continue reading Powershell – Error – InvalidCastFromStringToInteger – “Input string was not in a correct format.”