Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 5 years and 6 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Using Powershell Studio 2017
I have a Script that works normally as a .ps1 that uses the NTFSSecurity Module (https://gallery.technet.microsoft.com/s ... 85#content). If I Build the same files into a .exe the module is imported successfully, but when it comes to running the cmd's associated with the module I get an error.
Add-NTFSAccess : Could not load file or assembly 'AlphaFS, Version=2.2.0.0, Culture=neutral, PublicKeyToken=4d31a58f7d7ad5c9' or one of its dependencies. The system cannot find the file specified.
I understand this is saying a file can not be found but it runs normally as a script(.ps1). In Powershell Studio The Module is listed and checked in my cache.
Here Is the command
Files are not included in an EXE. The module must exist and be in the module path on the target system.
You should start by upgrading to the current version of the module:
Install-Module NTFSSecurity
This will upgrade the module.
Note that you must remove the existing "Gallery" module first by deleting its folder. The old module is not compatible with the PowerShell Gallery version
Cleared and rebuilt the module cache. Re-Built .exe and Im getting the same error.
Add-NTFSAccess : Could not load file or assembly 'AlphaFS, Version=2.2.0.0, Culture=neutral, PublicKeyToken=4d31a58f7d7ad5c9' or one of its dependencies.
The system cannot find the file specified.
I can build an EXE with no issues. Since this is a PSS 2017 issue I recommend posting in the REgister Customers forum for PSS and let the Sapien techs look at this. I do not have an installed version of 2017 so I cannot test with that version. Sapien has your version available.
The issue appears to be an issue with the build engine.
Was the right track. I didn't realize the module was 64bit (which could have been because I was running 64bit PS) so it was put in the SysWOW64 Module Directory. After I figured that out I did some more googleing because I was still getting the error. I found the link below which explains Importing the AlphaFS.dll as a module.
The download link from there leads to the page below, where you can download a zip file of multiple AlphaFS versions (Per my Error Message I needed 2.2.0).
This topic is 5 years and 6 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.