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
1
vote
0 answers

What does a module's manifest directive RequiredAssemblies do behind the scenes?

I have this simple (test-)module with the following manifest file (t\t.psd1): @{ ModuleVersion = '0.0.1' RequiredAssemblies = 'Oracle.DataAccess' } The corresponding module file (t\t.psm1) is equally simple: function t {} After…
René Nyffenegger
  • 39,402
  • 33
  • 158
  • 293
1
vote
1 answer

Whats the correct way to get output for this Powershell in C#

I am not getting any error below but I am also not getting the output. Below is the Powershell cmd and the C# method which is calling it. I would like to know if it is written correctly and how can I get the output as coming from powershell. It…
ZZZSharePoint
  • 1,163
  • 1
  • 19
  • 54
1
vote
1 answer

Powershell command not recognized when calling from C#

This is in continuation to this Question here, I have a PowerShell command which I have created and am able to call the command in a PowerShell window, but when trying to call from C# method, I am getting error as the cmdlet is not recognized, I…
ZZZSharePoint
  • 1,163
  • 1
  • 19
  • 54
1
vote
1 answer

PowerShell Object returns null

I have below command and it returns me null object . When I run the command separately in PowerShell window I get the right result. Below is my PowerShell method which is calling the command and the also the PowerShell command which I have defined.…
ZZZSharePoint
  • 1,163
  • 1
  • 19
  • 54
1
vote
3 answers

Azure DevOps PowerShell task fails to load 'Az.CosmosDB' module

I have an Azure DevOps pipeline to rotate Cosmos DB account keys. To do this, I'm using PowerShell and the New-AzCosmosDBAccountKey cmdlet. For some unknown reason, the Az.CosmosDB module is not installed with Az, so it needs to be installed…
David Gard
  • 11,225
  • 36
  • 115
  • 227
1
vote
1 answer

Issues with PowerShell Repositories on Azure DevOps Agents

Sorry for the very long post, but I am really stuck and hope someone can help. I've been back and forth so many times and I am hitting many issues with everything that has to do with PowerShell repositories and Azure DevOps agents. The end goal is…
1
vote
2 answers

Powershell Find-Module not finding all versions

I am using PS 5.1 under Win 10. Find-Module for PSColor is finding only version 1.0.0.0 (see below). But https://www.powershellgallery.com/packages/PSColors/1.3.0 shows there are many more. Why? How can I get it detect all versions? How can I…
1
vote
1 answer

Default Output of a Type as Instance.ToString() in Powershell

I have a Powershell Cmdlet, it returns an object which PowerShell writes to the host nicely in a table for me. $> Get-SolarLunarName -Year 1700 -Month 12 SolarDateTime Year LunarMonth LunarDay 26/12/1700 00:00:00 1700 12 …
Craig.C
  • 561
  • 4
  • 17
1
vote
3 answers

How to install PowerShell modules for oracle cloud

Need oracle cloud commands to perform some operations. for that need oracle powershell modules for that.
1
vote
1 answer

How come Get-Module X shows something, but Get-Module X -ListAvailable does not?

Please, observe: C:\xyz\DevOps\DFDeploymentSmokeTests [master ≡]> get-module xyz.PS.Dev -ListAvailable | ft -AutoSize C:\xyz\DevOps\DFDeploymentSmokeTests [master ≡]> get-module xyz.PS.Dev | ft -AutoSize ModuleType Version Name …
mark
  • 59,016
  • 79
  • 296
  • 580
1
vote
2 answers

Powershell module (psm1) auto-execute function after module load

just AFTER a module loads (.psm1)... I want a specific function in that module to be executed. It is not BEFORE the loading.. it's after the loading<...> so please do not mention (.psd1) 'ScriptsToProcess' I know I can execute the function after…
ZEE
  • 2,931
  • 5
  • 35
  • 47
1
vote
3 answers

match regex and replace bug with special charakters

I've built a script to read all Active Directory Group Memberships and save them to a file. Problem is, the Get-ADPrincipalGroupMembership cmdlet outputs all groups like this: CN=Group_Name,OU=Example Mail,OU=Example Management, DC=domain,DC=de So…
1
vote
0 answers

Powershell custom module CommandNotFoundException

When I import my module I can't access the exposed members. Placed my module in C:\Program Files\WindowsPowerShell\Modules. When I import my module in powershell by: Import-Module StuiterModule -Verbose and then enter Invoke-Reboot it gives the…
StuiterSlurf
  • 2,464
  • 4
  • 34
  • 55
1
vote
1 answer

How to properly set function scope within a powershell module?

Background I'd like all of my scripts and modules to be based on a template script which takes care of some common "housekeeping" tasks. Some of my modules are interdependent, and so I might load a module within another module, even if…
Lockszmith
  • 2,173
  • 1
  • 29
  • 43
1
vote
0 answers

How to create a powershell-5 module with multiple .psm1 files

Lest say I have three classes names Dog, Cat and Tree in matching files Dog_file.psm1,Cat_file.psm1 and Tree_file.psm1. I need to create one Powershell module with these three files. while I'm reading trough…
Nayana Adassuriya
  • 23,596
  • 30
  • 104
  • 147