Questions tagged [powershell-module]

Powershell Modules are sets of related Windows PowerShell functionalities that can be dynamic or persist on disk. Modules can contain cmdlets, providers, functions, variables, aliases and PowerShell drives.

A Powershell Module is a set of related Windows PowerShell functionalities that can be dynamic or persist on disk. Modules that persist on disk are referenced, loaded, and persisted as script modules, binary modules, or manifest modules.

Related Cmdlets

  • ImportSystemModules
  • New-Module
  • Import-Module
  • Export-ModuleMember
  • Get-Module
  • Remove-Module
  • New-ModuleManifest
  • Test-ModuleManifest
203 questions
2
votes
1 answer

How does Powershell Auto-Load Modules?

We learn that Powershell introduced Module Auto-Loading in 3.0 : ... PowerShell imports modules automatically the first time that you run any command in an installed module. You can now use the commands in a module without any set-up or profile…
Martin Ba
  • 37,187
  • 33
  • 183
  • 337
2
votes
1 answer

Issue with Start-ThreadJob ScriptBlock Unable to find powershell script

I am using Start-ThreadJob and ScriptBlock to execute a powershell script in a new thread. It works fine on my local but on the preprod server, I am getting an error. Code Block where I am initiating a new thread Start-ThreadJob -InputObject…
Tarun Bhatt
  • 727
  • 2
  • 8
  • 28
2
votes
0 answers

Mirroring PowerShell modules repository in to Artifactory

We want to mirror PowerShell module repository in to our Artifactory instance as a Virtual repo, to have the ability to obtain needed modules from our Azure VM Has any one done that before? Is there any documentation on how to mirror PowerShell…
wehelpdox
  • 339
  • 6
  • 16
2
votes
0 answers

Update-help -FullyQualifiedModule

When I have multiple versions of a module installed and I try to Update-Help for just a specific version, it tries to update all versions of the module. If any of the versions fail to update, Update-Help returns an error. The error doesn't include…
joeking
  • 2,006
  • 18
  • 29
2
votes
2 answers

Auto-Loading Cmdlets as part of a Module dynamically

So, I was thinking: I have a lot (!) of custom cmdlets, but I don't want them to load all of them in my profile, because, naturally, that will take a lot of time. (I work fast, so my tools need to be fast.) But also, I don't want to always load them…
marsze
  • 15,079
  • 5
  • 45
  • 61
2
votes
1 answer

VS Code - Powershell Modules - Command not recognised

I am a little perplexed by this, i've been using VS Code for Writing PowerShell for over a year and had no issues until recently when it has started to reject fairly standard cmdlets as unknown. Today I was trying to use Get-Eventlog Get-EventLog…
2
votes
1 answer

how to install a Powershell module in Powershell 4?

I have some machines on Powershell 4 In these machines even after I have placed the new powershell modules within the module path they don't show up in the Modules drop down list - as above. when I do the same thing in machines that are on…
2
votes
1 answer

Why would I need a module manifest - because the module nesting limit has been exceeded

I just got an error in Powershell: because the module nesting limit has been exceeded. Modules can only be nested to 10 levels. I found this and found something called a "module manifest". I already have a module .psm1 files - why do I also need…
Chris G.
  • 23,930
  • 48
  • 177
  • 302
2
votes
1 answer

using module $PSScriptRoot: is not a valid value for using name

How do you use using module with $PSScriptRoot? using module $PSScriptRoot/../myfolder/base.psm1 # or: using module "$PSScriptRoot/../myfolder/base.psm1" If I do this, I get this error: using module $PSScriptRoot: is not a valid value for using…
Chris G.
  • 23,930
  • 48
  • 177
  • 302
2
votes
3 answers

PowerShell functions load from function

I have a module with several files with functions and module loader. The example function: Function1.ps1 function Init() { echo "I am the module initialization logic" } function DoStuff() { echo "Me performing important stuff" } Module…
Stadub Dima
  • 858
  • 10
  • 24
2
votes
1 answer

How to force a module function definition to reload without starting a new Powershell session?

I have a module, let me call it xyz.ps.core. It exports a function - Get-PullRequestsFromCommitIds I fixed a bug in the function, republished the module, reinstalled and reimported it and yet the function still refers to the old version of the…
mark
  • 59,016
  • 79
  • 296
  • 580
2
votes
1 answer

How to export a variable from a powershell module function?

Please, observe: C:\> $TestVariable C:\> $a C:\> get-command Test-VariableExport CommandType Name Version Source ----------- ---- ------- …
mark
  • 59,016
  • 79
  • 296
  • 580
2
votes
1 answer

How can I set up a default powershell profile for all my co workers at work as simple as possible?

What do I want to achieve? I have one ps1 file that has all of my functions inside. In the first step I want to convert it into a ps module. Then I want to have the following: Colleague gets a script or bat he has to run ONCE. This will set his…
GeraltDieSocke
  • 1,524
  • 3
  • 20
  • 51
2
votes
0 answers

Powershell: reference class inside and outside module

I'm trying to use classes and reference them within each other. Unfortunately I can't seem to figure it out how. What I try to do is: Create a module exporting classes in different files. One of the classes has a method which returns another…
mattderi
  • 21
  • 4
2
votes
0 answers

Referencing files included in the FileList attribute in a manifest

I am writing a PowerShell module that will perform various configurations on our product including some xml transformations. So, I need to include the XDT files in my module. My module manifest will include the FileList attribute with a list of all…
Mickey Cohen
  • 997
  • 7
  • 23