Forked from gwalkey/gist:b168d532b472333e96663cf607bf84eb
Created
May 26, 2023 00:36
-
-
Save rvrsh3ll/78739132045f7a58a6428830f44cdec4 to your computer and use it in GitHub Desktop.
Revisions
-
gwalkey revised this gist
Apr 15, 2020 . No changes.There are no files selected for viewing
-
gwalkey revised this gist
Apr 13, 2020 . 1 changed file with 1 addition and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -41,12 +41,8 @@ Install-Package MyModuleName -- Check Nuget Package Version After Installation get-package | where-object {$_.name -match 'MyModuleName'} --- Test Loading/Calling a Function from your PS Module MyFunction --- List all functions in your PSM1 module Get-Command -Module MyModuleName -
gwalkey revised this gist
Apr 13, 2020 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,6 @@ Download the CLI Version of NuGet https://dist.nuget.org/win-x86-commandline/latest/nuget.exe --Create Work Paths md c:\nuget md c:\nuget\source -
gwalkey created this gist
Apr 13, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,52 @@ --Create Work Paths md c:\nuget md c:\nuget\source md c:\nuget\publish -- One-Time - Create local NuGet Repo/feed using a local drive path cd c:\nuget Register-PSRepository -Name Local_Nuget_Feed -SourceLocation C:\Nuget\publish -PublishLocation c:\Nuget\publish -InstallationPolicy Trusted (To Remove: Unregister-PSRepository -Name Local_Nuget_Feed) --- Verift/Show all PS Repository Get-PSRepository -- Create Prep folder for your New NuGet Package cd c:\nuget\source md MyModuleName Copy MyModuleName.PSD1 and MyModuleName.PSM1 files from your dev location to here (c:\nuget\source\MyModuleName) -- Edit your Powershell Module Manifest .psd1 File Set the RootModule to the name of your Module.psm1 file Set the ModuleVersion --- Create and Install your Powershell Module as a NuGet Package ans save into the Nuget Package Repo/Feed cd c:\nuget\source Publish-Module -Path .\MyModuleName -Repository Local_Nuget_Feed -NuGetApiKey 'ABC123' (The .nupkg file is created here: c:\nuget\publish) -- List Packages in Repository nuget list -source c:\nuget\publish -- Delete Package nuget delete MyModuleName 1.0.3 -source c:\nuget\publish --- Install your Powershell module from the .nupkg file you just created --- In an Elevated Powershell console: Install-Package MyModuleName -- Check Nuget Package Version After Installation get-package | where-object {$_.name -match 'MyModuleName'} --- Install Modules and Check Status Install-Module MyModuleName -Repository Local_Nuget_Feed Get-Module -ListAvailable -Name MyModuleName --- Test Loading/Calling a Function from your PS Module LoadSQLSMO --- List all functions in your PSM1 module Get-Command -Module MyModuleName --- Verify the correct version of your module and manifest files were installed in the Global Modules Folder here: C:\Program Files\WindowsPowerShell\Modules\MyModuleName