# Restricted Language? Error trying to import module

**URL:** <https://forums.powershell.org/t/restricted-language-error-trying-to-import-module/14301>\
**Category:** PowerShell Help\
**Created:** [April 30, 2020, 2:32pm UTC](https://forums.powershell.org/t/restricted-language-error-trying-to-import-module/14301 "2020-04-30T14:32:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeff-toy](https://avatars.discourse-cdn.com/v4/letter/j/a8b319/32.png) [@jeff-toy](https://forums.powershell.org/u/jeff-toy)\
**Post date:** [April 30, 2020, 2:32pm UTC](https://forums.powershell.org/t/restricted-language-error-trying-to-import-module/14301/1 "2020-04-30T14:32:06Z")

</div>

I am trying to import Don Jones’ “EnhancedHTML2” module. I downloaded the files from GitHub and copied them to my Modules folder (my server doesn’t have access to external sites). When I try to import the module, I receive an error about the module manifest. Error is below. I am in “FullLanguage” mode (not constrained/restricted). I have seen sites when researching this error, but have found no solution yet. Any ideas?

&nbsp;

Error:

Test-ModuleManifest : The module manifest  
‘C:\Windows\system32\WindowsPowerShell\v1.0\Modules\EnhancedHTML2\EnhancedHTML2.psd1’ could not be processed because  
it is not a valid Windows PowerShell restricted language file. Remove the elements that are not permitted by the  
restricted language:  
At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\EnhancedHTML2\EnhancedHTML2.psd1:1 char:1

- $script = ‘’
- 

```auto

```

Assignment statements are not allowed in restricted language mode or a Data section.  
At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\EnhancedHTML2\EnhancedHTML2.psd1:1 char:1

- $script = ‘’
- 

```auto

```

A variable that cannot be referenced in restricted language mode or a Data section is being referenced. Variables that  
can be referenced include the following: $PSCulture, $PSUICulture, $true, $false, $null, $PSScriptRoot, $PSEdition.  
At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\EnhancedHTML2\EnhancedHTML2.psd1:2 char:1

- function ConvertTo-EnhancedHTML {
- 

```auto

```

Function declarations are not allowed in restricted language mode or a Data section.  
At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\EnhancedHTML2\EnhancedHTML2.psd1:2 char:33

- function ConvertTo-EnhancedHTML {
- ~  
Script block literals are not allowed in restricted language mode or a Data section.  
At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\EnhancedHTML2\EnhancedHTML2.psd1:61 char:5
- param(
- 

```auto

```

Parameter declarations are not allowed in restricted language mode or a Data section.  
At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\EnhancedHTML2\EnhancedHTML2.psd1:60 char:5

- [CmdletBinding()]
- 

```auto

```

Attributes are not allowed in restricted language mode or a Data section.  
At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\EnhancedHTML2\EnhancedHTML2.psd1:62 char:17

- [string]$jQueryURI = '[http://ajax.aspnetcdn.com/ajax/jQuery/j](http://ajax.aspnetcdn.com/ajax/jQuery/j) …
- 

```auto

```

A variable that cannot be referenced in restricted language mode or a Data section is being referenced. Variables that  
can be referenced include the following: $PSCulture, $PSUICulture, $true, $false, $null, $PSScriptRoot, $PSEdition.  
At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\EnhancedHTML2\EnhancedHTML2.psd1:63 char:17

- [string]$jQueryDataTableURI = '[http://ajax.aspnetcdn.com/ajax](http://ajax.aspnetcdn.com/ajax) …
- 

```auto

```

A variable that cannot be referenced in restricted language mode or a Data section is being referenced. Variables that  
can be referenced include the following: $PSCulture, $PSUICulture, $true, $false, $null, $PSScriptRoot, $PSEdition.  
At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\EnhancedHTML2\EnhancedHTML2.psd1:64 char:9

- [Parameter(ParameterSetName=‘CSSContent’)][string]$CssStyle …
- 

```auto

```

Attributes are not allowed in restricted language mode or a Data section.  
At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\EnhancedHTML2\EnhancedHTML2.psd1:64 char:61

- … [Parameter(ParameterSetName=‘CSSContent’)][string]$CssStyleSheet,
- 

```auto

```

A variable that cannot be referenced in restricted language mode or a Data section is being referenced. Variables that  
can be referenced include the following: $PSCulture, $PSUICulture, $true, $false, $null, $PSScriptRoot, $PSEdition.  
Not all parse errors were reported. Correct the reported errors and try again.  
At line:1 char:1

- Test-ModuleManifest C:\Windows\system32\WindowsPowerShell\v1.0\Module …
- 

```auto

```

- CategoryInfo : ResourceUnavailable: (C:\Windows\syst…ancedHTML2.psd1:String) [Test-ModuleManifest], M  
issingMemberException
- FullyQualifiedErrorId : Modules\_InvalidManifest,Microsoft.PowerShell.Commands.TestModuleManifestCommand

---

<div class="post-metadata">

**Author:** ![krzydoug](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/krzydoug/32/1008_2.png) [@krzydoug](https://forums.powershell.org/u/krzydoug)\
**Post date:** [April 30, 2020, 4:10pm UTC](https://forums.powershell.org/t/restricted-language-error-trying-to-import-module/14301/2 "2020-04-30T16:10:18Z")

</div>

Did you confirm you were in full language mode with

```
$ExecutionContext.SessionState.LanguageMode
```

&nbsp;

---

<div class="post-metadata">

**Author:** ![jeff-toy](https://avatars.discourse-cdn.com/v4/letter/j/a8b319/32.png) [@jeff-toy](https://forums.powershell.org/u/jeff-toy)\
**Post date:** [April 30, 2020, 4:21pm UTC](https://forums.powershell.org/t/restricted-language-error-trying-to-import-module/14301/3 "2020-04-30T16:21:07Z")

</div>

Yes. I am in FullLanguage mode. I have never updated that setting.

---

<div class="post-metadata">

**Author:** ![krzydoug](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/krzydoug/32/1008_2.png) [@krzydoug](https://forums.powershell.org/u/krzydoug)\
**Post date:** [April 30, 2020, 4:27pm UTC](https://forums.powershell.org/t/restricted-language-error-trying-to-import-module/14301/4 "2020-04-30T16:27:39Z")

</div>

Right, but just for sanity sake, you ran that?

---

<div class="post-metadata">

**Author:** ![krzydoug](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/krzydoug/32/1008_2.png) [@krzydoug](https://forums.powershell.org/u/krzydoug)\
**Post date:** [April 30, 2020, 4:36pm UTC](https://forums.powershell.org/t/restricted-language-error-trying-to-import-module/14301/5 "2020-04-30T16:36:17Z")

</div>

OK try this. Instead of downloading from github, download the nuget package from [here](https://www.powershellgallery.com/packages/EnhancedHTML2/2.0)

Extract the package like a zip file, I used 7-zip. Then copy/import them. This package worked when the one from Github did not.

I hope this helps.

---

<div class="post-metadata">

**Author:** ![jeff-toy](https://avatars.discourse-cdn.com/v4/letter/j/a8b319/32.png) [@jeff-toy](https://forums.powershell.org/u/jeff-toy)\
**Post date:** [April 30, 2020, 6:04pm UTC](https://forums.powershell.org/t/restricted-language-error-trying-to-import-module/14301/6 "2020-04-30T18:04:01Z")

</div>

That worked! Strange - Seems like the contents switched over from the psd1 to the psm1. Either way, working now. Thanks

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:29pm UTC](https://forums.powershell.org/t/restricted-language-error-trying-to-import-module/14301/7 "2024-05-16T20:29:45Z")

</div>

Closed on May 16, 2024, 8:29pm UTC


