PowerShell doesn’t validate command line parameter names

Today, I came across a weird behavior by PowerShell that it doesn’t validate the parameter names 🙁 Below is the sample code that explains the behavior i am speaking about: PS C:> type .Test-Commandline-Parameters.ps1 param([switch]$Debug) Write-Host $Debug PS C:> .Test-Commandline-Parameters.ps1 -debug True PS C:> .Test-Commandline-Parameters.ps1 -debugging False PS C:> .Test-Commandline-Parameters.ps1 -debu True PS C:> .Test-Commandline-Parameters.ps1 -de True PS C:> .Test-Commandline-Parameters.ps1 -d True PS C:> .Test-Commandline-Parameters.ps1 -debeg False PS C:> .Test-Commandline-Parameters.ps1 -deer False PS C:>   For more details read my article in MS PS TechNet Forums here.

Read more

Fixing SQL Error: Login failed for user ‘<domainname><computername>$’

Many applications that communicate to the SQL DB located on a remote SQL server will at times report an unexpected error ‘Login failed for user ‘<domainname><computername>$’’. Analysis: The error usually indicates logon failure for the reported user account for the specified DB on the respective server. Usually there should be a SQL/Domain user id that may attempt to login, but if it’s a computer name instead then that indicates probably System account or ASP.Net accounts attempts for that login. Possible Cause: The most possible case I noticed is that application get configured to use “Built-in ASP.Net” account. Possible Fix: Make […]

Read more