Using powershell for the first time - REALLY simple question.

Posted on 2012-08-17
Last Modified: 2012-08-17
I'm trying to run a .ps1 file located at...

C:\Program Files (x86)\Puma\Puma.ps1

...inside a batch file.  Can you tell me the batch command I need?  I have tried encasing the patch in quotation marks, i.e.

powershel.exe "C:\Program Files (x86)\Puma\Puma.ps1" -nologo

but it says 'C:\Program' is not a script, cmdlet, etc.

Does powershell have a different way of doing the same job as quotation marks in batch?

I really can't find anything about this on the web, surprisingly.

Question by:meirionwyllt
    LVL 11

    Expert Comment

    Just change your command as

    Powershell.exe `"C:\Program Files (x86)\Puma\Puma.ps1"
    LVL 13

    Expert Comment

    Here is a great tutorial for what you're looking to do:

    Author Comment

    Really?  Is there no one-line approach??

    Not that it really matters, but I didn't expect that powershell would be this restrictive seeing as its such a new language.

    In your second line, in front of the $dollar sign, is that an inverted comma (on the @ key) or a ` (the button left of the number 1 key).
    LVL 13

    Accepted Solution

    You could use

    powershell.exe  -File "C:\Program Files (x86)\Puma\Puma.ps1"

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    Are you one of those front-line IT Service Desk staff fielding calls, replying to emails, all-the-while working to resolve end-user technological nightmares? I am! That's why I have put together this brief overview of tools and techniques I use in o…
    The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
    This tutorial will walk an individual through the steps necessary to configure their installation of BackupExec 2012 to use network shared disk space. Verify that the path to the shared storage is valid and that data can be written to that location:…
    This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now