Search

  • Re: Load Multiple Modules (.psm1) using a single psd1 file

    I corrected my issues. Thanks, you were right. It was a typo. It should be . .\test.ps1 [Note the space between dots] & this article from Snover clears all doubts regarding dot-sourcing... http://blogs.msdn.com/b/powershell/archive/2007/06/19/get-scriptdirectory.aspx - Brilliant !!!
    Posted to PowerShell for Windows (Forum) by Angshuman on 04-25-2012
    Filed under: powershell append to content, Execute Scripts, ps1, Dot-Sourcing
  • Remove global constant variables when a module is removed

    Hi, I need to remove / unload constant global variables when a module gets removed using the remove- module cmdlet. Additionally, the remove- variable documentation in MSDN says - You cannot use this cmdlet to delete variables that are set as constants or those that are owned by the system. - http://technet.microsoft.com/en-us/library/dd347612.aspx Is there any workaround or hack ?
    Posted to General (Forum) by Angshuman on 04-25-2012
    Filed under: Modules, power shell, Variables
  • Re: Load Multiple Modules (.psm1) using a single psd1 file

    Sorry, I think I am missing something. I tried what you suggested, but I get the following error. I ran using Powershell x86 command prompt shell as well as ISE. I am running from the directory where the file is saved i.e. same level The term '..\Test.ps1' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:12 + ..\Test.ps1 <<<<
    Posted to PowerShell for Windows (Forum) by Angshuman on 04-24-2012
    Filed under: powerershell, command prompt, Function
  • Re: Load Multiple Modules (.psm1) using a single psd1 file

    But, is it possible to call any function directly inside the loaded .ps1 files [as you say above] directly like Modules ? I am asking this because I am struggling to call a parameterised function inside a ps1 file using dot-sourcing from command line- function f([string]$a, [string]$b) { Write-Host "a:", $a, " b:", $b } Save the above as Test.ps1 and load from the commad prompt as .\Test.ps1 & then call the function as f "a" "b" I get following error -
    Posted to PowerShell for Windows (Forum) by Angshuman on 04-23-2012
    Filed under: powerershell, command prompt, Function
  • Re: Powershell - Generate and execute scripts on the fly programmatically

    Hi, I am now breaking down my requirements step by stpe. I have a new question very specific to modules - http://powershell.com/cs/forums/t/9672.aspx Hope I am clear now
    Posted to PowerShell for Windows (Forum) by Angshuman on 04-18-2012
    Filed under: Module, psd1, psm1
  • Load Multiple Modules (.psm1) using a single psd1 file

    Hi, I want to organize functions into multiple .psm1 files and have them loaded by a single Module Manifest file (.psd1) . So, the .psd1 and multiple .psm1 files would sit under the same "module_name/" directory. Only the .psd1 file would need to have the same name as the module. I think it should be possible. Can anyone help me out please ?
    Posted to PowerShell for Windows (Forum) by Angshuman on 04-18-2012
    Filed under: Module, psd1, psm1
  • Powershell - Generate and execute scripts on the fly programmatically

    I had posted my question on stackoverflow here - - http://stackoverflow.com/questions/9601733/powershell-generate-and-execute-scripts-on-the-fly-programmatically Thanks in advance.
    Posted to PowerShell for Windows (Forum) by Angshuman on 03-08-2012
    Filed under: generate scripts programmatically
Page 1 of 1 (7 items) | RSS | More Search Options
Copyright 2012 PowerShell.com. All rights reserved.