DataGridViewAutoSizeColumnMode type not found
After removing AsJob = $true in sqlmonitor.ps1, received an unknown type error.
Unable to find type [DataGridViewAutoSizeColumnMode]. At ...\PowerShell\Modules\MonitorFactory\Components\Start-Monitor.ps1:506 char:22
-
$_.AutoSizeMode = [DataGridViewAutoSizeColumnMode]::None -
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~- CategoryInfo : InvalidOperation: (DataGridViewAutoSizeColumnMode:TypeName) [], RuntimeException
- FullyQualifiedErrorId : TypeNotFound
I had to fully qualify DataGridViewAutoSizeColumnMode at line 506 in start-monitor.ps1
$_.AutoSizeMode = [System.Windows.Forms.DataGridViewAutoSizeColumnMode]::None
Was I doing something wrong and did my "fix" actually fix something, or did some other cosmic event take place that made it run without throwing an error?
Thanks, jrconley4. Most likely this was my error: likely when I tested that code path I had already had the library in my environment so it found it without a fully qualified path. I just updated the code exactly as you surmised to provide the full path.