Running .ps1 to PowerShell

Welcome Forums General PowerShell Q&A Running .ps1 to PowerShell

This topic contains 2 replies, has 3 voices, and was last updated by

 
Participant
4 years, 6 months ago.

  • Author
    Posts
  • #18443

    Participant
    Points: 0
    Rank: Member

    I am fairly new to PowerShell & one of the virtual learning I've seen was a series of .ps1 file was created and then dragged into the PowerShell window and the script ran.
    I couldn't asked a question on that tutorial since it's a recorded one.

    Anybody know's how to do this?
    I know how to create the .ps1 and is able to run my script by right clicking and selecting to Run in PowerShell.

    But I need to know how to do the drag and drop and script gets executed.

    Thanks.

  • #18444

    Member
    Points: 0
    Rank: Member

    I'd never tried this before. When I drag a PS1 file onto my open PowerShell console, it fills in the file name on the command line. All that was needed to run the script was to press Enter. I assume that if this is what was done in the video you watched, they also pressed Enter, but you didn't see that part in the recording.

  • #18445

    Participant
    Points: 0
    Rank: Member

    I just tried this as well and I can confirm that dragging a ps1 file onto the shell itself will enter in the file's directory via command line. I also had to press enter to get it to execute, and then it worked.

The topic ‘Running .ps1 to PowerShell’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort