# Convert PowerShell script to executable file

**URL:** <https://forums.powershell.org/t/convert-powershell-script-to-executable-file/25512>\
**Category:** PowerShell Help\
**Created:** [March 1, 2025, 7:07am UTC](https://forums.powershell.org/t/convert-powershell-script-to-executable-file/25512 "2025-03-01T07:07:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hack3rcon](https://avatars.discourse-cdn.com/v4/letter/h/96bed5/32.png) [@Hack3rcon](https://forums.powershell.org/u/Hack3rcon)\
**Post date:** [March 1, 2025, 7:07am UTC](https://forums.powershell.org/t/convert-powershell-script-to-executable-file/25512/1 "2025-03-01T07:07:28Z")

</div>

Hello,  
I used the `Win-PS2EXE` tool to convert the script to an .exe file, but when I run the executable file, I see the following errors:

```auto
ERROR: Could not retrieve information about the Security log. Error: Attempted to perform an unauthorized operation..
ERROR: There is not an event log on the localhost computer that matches "Security".

```

The script works correctly, but its executable file does not work!

Thank you.

---

<div class="post-metadata">

**Author:** ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)\
**Post date:** [March 1, 2025, 12:50pm UTC](https://forums.powershell.org/t/convert-powershell-script-to-executable-file/25512/2 "2025-03-01T12:50:50Z")

</div>

> [@Hack3rcon](#):
>
> The script works correctly, but its executable file does not work!

Since `PS2EXE` has limitations or conditions it’s still possible that the error is caused by something you have in your script. ☝ 😉 🤷‍♂️

---

<div class="post-metadata">

**Author:** ![neemobeer](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/neemobeer/32/4087_2.png) [@neemobeer](https://forums.powershell.org/u/neemobeer)\
**Post date:** [March 2, 2025, 4:37pm UTC](https://forums.powershell.org/t/convert-powershell-script-to-executable-file/25512/3 "2025-03-02T16:37:57Z")

</div>

Are you running ‘as admin’? The security event log requires elevated rigths

---

<div class="post-metadata">

**Author:** ![Hack3rcon](https://avatars.discourse-cdn.com/v4/letter/h/96bed5/32.png) [@Hack3rcon](https://forums.powershell.org/u/Hack3rcon)\
**Post date:** [March 4, 2025, 6:52am UTC](https://forums.powershell.org/t/convert-powershell-script-to-executable-file/25512/4 "2025-03-04T06:52:23Z")

</div>

Hello,  
I used `Invoke-ps2exe` and the problem was fixed.

Thank you.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/powershell/original/1X/385e4f9fe133561ad30a814262fe0e0ae6bc3ef0.png) [@system](https://forums.powershell.org/u/system)\
**Post date:** [April 3, 2025, 6:52am UTC](https://forums.powershell.org/t/convert-powershell-script-to-executable-file/25512/5 "2025-04-03T06:52:54Z")

</div>

Closed on April 3, 2025, 6:52am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
