Error importing the DellBIOSProvider module from executable

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

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 7 years and 1 month 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.
User avatar
rg2017
Posts: 4
Last visit: Thu Jul 20, 2023 4:37 pm

Error importing the DellBIOSProvider module from executable

Post by rg2017 »

Product, version and build: 5.4.135
(*** Please do not write "latest" as a version, specify a version number ***)
32 or 64 bit version of product: 64 bit
Operating system: Windows 10
32 or 64 bit OS: 64 bit
PowerShell Version: 5

Hi!,
I am getting an error when executing package created in PowerShell Studio.
I am trying to load the DellBIOSProvider (https://www.powershellgallery.com/packa ... ovider/1.0), but it fails to import with the following erros/messages:

ERROR: http://go.microsoft.com/fwlink/?LinkID=135170.
ERROR: At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\DellBIOSProvider\DellBIOS
ERROR: Provider.psm1:1 char:2
ERROR: + .$psScriptRoot\Set-Dell1stBootdevice.ps1
ERROR: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ERROR: + CategoryInfo : SecurityError: (:) [], ParentContainsErrorRecord
ERROR: Exception
ERROR: + FullyQualifiedErrorId : UnauthorizedAccess
ERROR: Import-Module : The module to process 'DellBIOSProvider.psm1', listed in field
ERROR: 'NestedModules' of module manifest 'C:\Windows\system32\WindowsPowerShell\v1.0\
ERROR: Modules\DellBIOSProvider\DellBIOSProvider.psd1' was not processed because no
ERROR: valid module was found in any module directory.
ERROR: At line:22 char:2
ERROR: + Import-Module DellBIOSProvider
ERROR: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ERROR: + CategoryInfo : ResourceUnavailable: (DellBIOSProvider:String) [
ERROR: Import-Module], PSInvalidOperationException
ERROR: + FullyQualifiedErrorId : Modules_ModuleFileNotFound,Microsoft.PowerShell.
ERROR: Commands.ImportModuleCommand
ERROR:
DevinL
Posts: 1098
Last visit: Tue Jun 06, 2017 9:15 am

Re: Error importing the DellBIOSProvider module from executable

Post by DevinL »

How exactly do you attempt to import the module? Is it possible you could provide us with the script that's causing this?

Also, can you verify that the module is indeed installed at C:\Windows\system32\WindowsPowerShell\v1.0\Modules\DellBIOSProvider\?
DevinL
SAPIEN Technologies, Inc.
User avatar
rg2017
Posts: 4
Last visit: Thu Jul 20, 2023 4:37 pm

Re: Error importing the DellBIOSProvider module from executable

Post by rg2017 »

Devin,

Yes, the module is there. If you use regular Powershell script, then it is fine, but if you use the build option in PowerShell Studio to create an executable, then you get the error message that I posted.
I have attache a screenshot showing the module is there.

One thing that I noticed on the error message from the executable is that this "cannot be loaded because running scripts is disabled". It is my understanding that running the executable from memory doesn't require a change to the execution policy. Can this be part of the issue?



This is test script:

<#
.NOTES
===========================================================================
Created with: SAPIEN Technologies, Inc., PowerShell Studio 2017 v5.4.135
Created on: 2/23/2017 9:57 AM
Created by:
Organization:
Filename:
===========================================================================
.DESCRIPTION
A description of the file.
#>

<#
For more information on the try, catch and finally keywords, see:
Get-Help about_try_catch_finally
#>

# Try one or more commands
try {
#Import Dell BIOSProvider
Import-Module DellBIOSProvider
Write-Host "Module loaded"
}
# Catch specific types of exceptions thrown by one of those commands
catch [System.Exception] {
Write-Host "Module not loaded"
}
# Catch all other exceptions thrown by one of those commands
catch {
}
Attachments
DellBIOSProviderError.PNG
DellBIOSProviderError.PNG (120.72 KiB) Viewed 7020 times
DevinL
Posts: 1098
Last visit: Tue Jun 06, 2017 9:15 am

Re: Error importing the DellBIOSProvider module from executable

Post by DevinL »

Yes, running the script in the executable doesn't require the execution policy to be modified, however since it calls the script at $psScriptRoot\Set-Dell1stBootDevice.ps1, that does require the execution policy be modified.

Since it's only the exe causing problems and everything else seems to be working fine, this is most likely a permission issue. I noticed you're running the executable as administrator, how exactly did you get your exe to run this way? We have an article here you may find of interest: https://www.sapien.com/blog/2017/01/19/ ... nistrator/
DevinL
SAPIEN Technologies, Inc.
User avatar
rg2017
Posts: 4
Last visit: Thu Jul 20, 2023 4:37 pm

Re: Error importing the DellBIOSProvider module from executable

Post by rg2017 »

Devin,

Yes, I am using the manifest with elevation when creating the executable.

IS there a way to include a change of execution policy in the executable? Also How can I get the USA AES 256 version of the packaging tool?

Thanks
DevinL
Posts: 1098
Last visit: Tue Jun 06, 2017 9:15 am

Re: Error importing the DellBIOSProvider module from executable

Post by DevinL »

This is indeed possible, I highly recommend a search for "PowerShell Execution Policy Registry".
DevinL
SAPIEN Technologies, Inc.
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: Error importing the DellBIOSProvider module from executable

Post by Alexander Riedel »

Please contact sales@sapien.com about the high encryption pack.
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 7 years and 1 month 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.