I'm getting some odd behavior from Excel's Cells.Find()
method:
Variable I'm searching on:
PS > $volumename
vol_01
PS > $volumename.GetType()
IsPublic IsSerial Name BaseType
-------- -------- ---- --------
True True String System.Object
produces no results:
PS > $sheet.Cells.Find($volumename).Row
but if I manually copy and paste the value of that variable:
PS > $volumename = "vol_01"
PS > $volumename.GetType()
IsPublic IsSerial Name BaseType
-------- -------- ---- --------
True True String System.Object
Gets the value I am expecting:
PS > $sheet.Cells.Find($volumename).Row
198
They appear to be exactly the same type in every way to me. This doesn't happen for every case. Some volume names passthrough fine while others do not. I did scrub the volume name for this post as it has a customers naming convention. It is the same format as above and the same format as the volume names that work.