I am trying to call a ps1 script through an ASP .net webpage. The first line on the script is an import-csv cmdlet. It fails saying the cmdlet is not recognized. I can run the same script from the powershell commandline and it works fine. Also if I remove
the import-csv line in the scipt, the script executes but I need to pass the input to the script from a csv file. Is there something special with import-csv command?
1 Post
Import-csv cmdlet not working when called from managed code
Oct 07, 2011 12:05 PM|geninfman|LINK
I am trying to call a ps1 script through an ASP .net webpage. The first line on the script is an import-csv cmdlet. It fails saying the cmdlet is not recognized. I can run the same script from the powershell commandline and it works fine. Also if I remove the import-csv line in the scipt, the script executes but I need to pass the input to the script from a csv file. Is there something special with import-csv command?
7914 Posts
Re: Import-csv cmdlet not working when called from managed code
Oct 07, 2011 12:19 PM|HCamper|LINK
Hi,
Can you post the code ?
Have you tried the IIS library sample http://learn.iis.net/page.aspx/160/writing-powershell-commandlets-for-iis-70/ ?
Martin
Community Member Award 2011