in reply to Error compiling script running powershell command

In addition to the perl interpolation issues others have pointed out, your variables carry names that have spaces.

This is likely to cause downstream powershell commandlet parsing errors.

Try populating the vairablles like this to keep their content quote-enclosed after interpolation:

my $un = '"steve gilbert"'; my $jpeg = '"v:/employee photos/out/steve gilbert.jpg"';

                We're living in a golden age. All you need is gold. -- D.W. Robertson.