none
Not able to run powershell script? RRS feed

  • Question

  • Under powershell, I get Unrestricted for this commend Get-ExecutionPolicy.

    When I input .\ABC.psl, it returns not able to recognize '.\ABC.psl' as Cmdlet, number, command or executable file.

    Location row: 1 , word: 14

    .\ABC.psl <<<<<

    CategoryInfo : ObjectNotFound: (.\ABC.psl:String) [], CommandNotFoundException

    FullyQualifiedErrorId : CommandNotFoundException

    Does anyone have any suggestions on what wrong it could be?
    Thanks in advance for any suggestions

    Scripts

    # File is generated on 22-Jun-14 | Clean directory for the next update files
    get-childitem D:\Temp\CSV -recurse |
     select -expand fullname |
     sort length -descending |
     remove-item


    Thanks in advance for any suggestions


    Saturday, June 21, 2014 11:32 PM

Answers

  • Try ".\ABC.ps1"

    You are typing psl 

    "one" and "el".  Not the same.


    ¯\_(ツ)_/¯


    • Edited by jrv Saturday, June 21, 2014 11:34 PM
    • Marked as answer by oemMicrosoft Saturday, June 21, 2014 11:53 PM
    Saturday, June 21, 2014 11:34 PM

All replies

  • Try ".\ABC.ps1"

    You are typing psl 

    "one" and "el".  Not the same.


    ¯\_(ツ)_/¯


    • Edited by jrv Saturday, June 21, 2014 11:34 PM
    • Marked as answer by oemMicrosoft Saturday, June 21, 2014 11:53 PM
    Saturday, June 21, 2014 11:34 PM
  • Thank you very much for suggestions :>

    Thanks in advance for any suggestions

    Saturday, June 21, 2014 11:53 PM
  • Thank you very much for suggestions :>

    Thanks in advance for any suggestions

    You can only use certain extensions with scripts.  PS1, PSD1, PSM1.  You cannot use PSL or any other odd extension.

    Good luck.


    ¯\_(ツ)_/¯

    Saturday, June 21, 2014 11:57 PM