locked
including the folders and files to create an exe using powershell script. RRS feed

  • General discussion

  • HI Team,

    I am very new to power shell script. Can any body help with creating an .exe using power shell script. My requirement is we will import the files and folders using power shell script and In scripting we need to write imported files and folders should copy to another locations. The entire scripting  should be create as .exe so that when will install the .exe in another system the same folders and files will copy as what written in script

    • Changed type Bill_Stewart Tuesday, February 2, 2016 3:08 PM
    Thursday, January 28, 2016 11:02 AM

All replies

  • Hi,

    just so I get it right:

    You want to have an .exe File, that when executed will run a PowerShell script?

    In that case, use Sapien PowerShell Studio. Best PowerShell editing tool out there and it can compile all scripts into .exe files. It also allows you to create GUIs easily.

    Cheers,
    Fred


    There's no place like 127.0.0.1

    Thursday, January 28, 2016 11:09 AM
  • If you don't want to pay for PowerShell Studio (you should consider it, I hear it's great), I believe PowerGUI can still do this as well.

    Thursday, January 28, 2016 1:48 PM
  • If you don't want to pay for PowerShell Studio (you should consider it, I hear it's great), I believe PowerGUI can still do this as well.

    Hey Mike,

    it's not just great - it's awesome! It also comes with a 45 day free trial*, so why don't you check it out yourself, no need to rely on hearsay in this ;)

    That said, PowerGUI can assembly scripts as executables as well, though it's nowhere near as powerful in many other aspects (say ... GUI). Also, while probably not of much concern in this case, packaged scripts by PowerGUI can be opened by 7zip and read, while the PowerShell Studio version is obfuscated and can't be read as easily.

    Cheers,
    Fred

    *Note: Executables built with the trial version will after some time stop to work, as it is a trial.


    There's no place like 127.0.0.1

    Thursday, January 28, 2016 3:43 PM
  • <threadjack>

    Hey Mike,

    it's not just great - it's awesome! It also comes with a 45 day free trial*, so why don't you check it out yourself, no need to rely on hearsay in this ;)

    At the end of the day I just don't want to get hooked on it, I doubt I could get a license purchase approved (even though technically I AM the approver but I don't want to have to explain myself away to the upstairs people over something I don't really have a solid need for). =]

    I don't really do GUI work with PowerShell anyway, I leave that kinda stuff for my dev team and their VS installs. The ISE suits my purposes after the v3 improvements were put in place.

    </threadjack>


    Thursday, January 28, 2016 3:57 PM
  • My main complaint with SAPIEN products is that the text editing features are pretty anemic, particularly for products at the price they're asking. I prefer a very robust text editor (my current preference is EmEditor) and sometimes the ISE for debugging.

    As an aside, there's really no such thing as "compiling" a PowerShell script. All these tools do is create an executable "wrapper" around a script. I've found that they sometimes don't work properly, depending on the script, but if it works for you, then great.


    -- Bill Stewart [Bill_Stewart]

    Thursday, January 28, 2016 4:13 PM
  • Hi guys,

    at the risk of getting a bit astray from the original topic, I can't help but be ask:

    @Mike: Why be afraid of getting hooked on it? If it does hook you, doesn't it mean you are more productive with it than with the ISE? Considering what your workhour costs your company, you'd probably save it the amount in little time. If you aren't more productive with it, you won't get addicted either, so that'd be that, but ... don't you owe it to your company to give it a chance?

    @Bill: Do you have some examples of what features you are missing? (Honest curiosity here. I'll try out EmEditor later, good features deserve to be stolen :) ).

    Cheers,
    Fred


    There's no place like 127.0.0.1

    Thursday, January 28, 2016 5:10 PM
  • @Mike: Why be afraid of getting hooked on it? If it does hook you, doesn't it mean you are more productive with it than with the ISE? Considering what your workhour costs your company, you'd probably save it the amount in little time. If you aren't more productive with it, you won't get addicted either, so that'd be that, but ... don't you owe it to your company to give it a chance?

    Wait a minute, are you working for Sapien now? That's a good sales pitch. =]


    Thursday, January 28, 2016 5:19 PM
  • Hi Fred, as you noted, this is off-topic - but the features I want are missing from the text editor. For example, I would like for the Home key to jump always to column 1. In SAPIEN products, it jumps to the first whitespace character on the line instead, and this behavior cannot be configured (nor can much of the keyboard). (As an aside, I requested this as a simple feature, and they shot it down.) The lack of configurability of the keyboard makes the product mostly unusable to me except for simple editing changes. Regular expression find and replace is weak. Product has no macros. These weaknesses are surprising to me for a product as expensive as it is. But if it works for you - like I said, to each his own.


    -- Bill Stewart [Bill_Stewart]

    Thursday, January 28, 2016 5:25 PM

  • Wait a minute, are you working for Sapien now? That's a good sales pitch. =]

    Thanks  :)
    That said, nope, I work for an IT service provider in southern Germany, doing mostly analysis work and maintaining our powershell toolbox. That said, Sapien has convinced me with very fast bugfixes and an open ear to many of my feature requests (which is part of why I'm so much more efficient with it than with any other editor - many small comfort requests of mine were implemented, that I can customize it towards my own scripting habits quite well).

    @Bill:
    Can't say I miss many of these features (I'll give that editor a chance though - I'm certainly not a perfectly objective observer currently. Habits are difficult to overcome for me but I'm sure it'll grant another perspective to me), though the key-binding one is a major point of contention for many users, me included.

    Cheers,
    Fred


    There's no place like 127.0.0.1

    Thursday, January 28, 2016 6:22 PM
  • Thanks team,

    Can I include the folders and files with out using GUI tools. I should include the folder and files in powershell script only. There should not be any GUI tool. All the files and folders need to include by power shell script and we need to create that as .exe using powershell.

    Friday, January 29, 2016 4:56 AM
  • Hi bforbalu,

    yes, you can (with either tool).

    Cheers,
    Fred


    There's no place like 127.0.0.1

    Friday, January 29, 2016 12:35 PM
  • Hi Fred,

    So can you tell me how should i start. Can any body give an example for simple script as create folders and files that copy from one location to another location and that entire folders should be an .exe.

    Saturday, January 30, 2016 5:01 AM
  • Hi bforbalu, this is not a support forum for third-party software. For information about a particular software, ask the vendor of the software.

    -- Bill Stewart [Bill_Stewart]

    Saturday, January 30, 2016 7:04 PM
  • So can any body tell how should we imports and what are commands to import files and folder.
    Tuesday, February 2, 2016 8:13 AM
  • Again: This is not a support forum for third-party software. You need to read the documentation for the tool you are using and/or ask the software's vendor.

    -- Bill Stewart [Bill_Stewart]

    Tuesday, February 2, 2016 3:08 PM