One of the problems is that the script loads system.windows.forms – which is inherently interactive. However, the script doesn’t appear to use it. So… take that line out.
Tell me more about your setup for “running your script”? From: listsad...@lists.myitforum.com [mailto:listsad...@lists.myitforum.com] On Behalf Of Sean Martin Sent: Friday, June 16, 2017 2:35 PM To: ntsysadm@lists.myitforum.com Subject: [NTSysADM] Set-ImageSize Help Good morning/afternoon, Looking for a bit of assistance. I'm writing a script to import photos into Active Directory and part of the process requires that the photos be resized, so I downloaded this gem: https://gallery.technet.microsoft.com/scriptcenter/Resize-Image-File-f6dd4a56 Importing and using the set-imagesize cmdlet works just fine when I run through the process interactively. However, I get the error "The term 'Set-ImageSize' is not recognized as the name of a cmdlet, function......" when I run my script. I've verified the "module" imports successfully, so I've been banging my head on why the cmdlet isn't recognized. Anyone run into a similar scenario?