# UNABLE TO USE CLASSES FROM MODULE

**URL:** <https://forums.powershell.org/t/unable-to-use-classes-from-module/10220>\
**Category:** PowerShell Help\
**Created:** [February 28, 2018, 10:49pm UTC](https://forums.powershell.org/t/unable-to-use-classes-from-module/10220 "2018-02-28T22:49:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![syobsyot](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/syobsyot/32/374_2.png) [@syobsyot](https://forums.powershell.org/u/syobsyot)\
**Post date:** [February 28, 2018, 10:49pm UTC](https://forums.powershell.org/t/unable-to-use-classes-from-module/10220/1 "2018-02-28T22:49:52Z")

</div>

HELLO PEOPLE,

I AM TRYING TO USE CLASS DEFINED IN A MODULE INSIDE A POWERSHELL SCRIPT. ALL INTERNET RESOURCES I HAVE FOUND INDICATE THAT THIS CODE SHOULD WORK. BUT IT DOES NOT IN MY CASE.  
C:\TEST.PSM1:

```
CLASS TEST{}
```

C:\TEST.PS1:

```
USING MODULE C:\TEST.PSM1;
[TEST]
```

WHEN RUNNING THIS SCRIPT, I GET ERROR SAYING THAT TEST IS NOT DEFINED. BUT I HAVE READ INTERNET POSTS ABOUT USING THIS SYNTAX, AND IT WORKES IN THOSE POSTS. I DO NOT KNOW WHY IT DOES NOT WORK FOR ME.

HAVE ANY IDEA? IS MY POWER SHELL BROKEN?

FOR ANY POTENTIAL REPLYS, THANK YOU.

---

<div class="post-metadata">

**Author:** ![richard-siddaway](https://avatars.discourse-cdn.com/v4/letter/r/d78d45/32.png) [@richard-siddaway](https://forums.powershell.org/u/richard-siddaway)\
**Post date:** [March 1, 2018, 7:05am UTC](https://forums.powershell.org/t/unable-to-use-classes-from-module/10220/2 "2018-03-01T07:05:23Z")

</div>

I can’t reproduce your problem as your code works for me in both ISE and PowerShell console.

Please stop using all capital letters in your posts it makes them more difficult to read

---

<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:36pm UTC](https://forums.powershell.org/t/unable-to-use-classes-from-module/10220/3 "2024-05-16T20:36:19Z")

</div>

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


