From 439ea6a334a377fd7d1d9207863222f8b00bc805 Mon Sep 17 00:00:00 2001 From: Manikyam Bavandla Date: Tue, 19 Jul 2016 12:53:19 -0700 Subject: [PATCH 1/2] PowerShellGet demo script PowerShellGet demo script --- demos/PowerShellGet.ps1 | 59 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 demos/PowerShellGet.ps1 diff --git a/demos/PowerShellGet.ps1 b/demos/PowerShellGet.ps1 new file mode 100644 index 000000000..2dae82871 --- /dev/null +++ b/demos/PowerShellGet.ps1 @@ -0,0 +1,59 @@ +Get-Command -Module PowerShellGet + +Get-PSRepository + +Register-PSRepository -Name PSGalleryINT -SourceLocation https://dtlgalleryint.cloudapp.net -InstallationPolicy Trusted + +Get-PSRepository + +Find-Module +Find-Module ContosoServer + +Save-Module ContosoServer -Path /tmp +Get-ChildItem -Path /tmp/ContosoServer -Recurse + +Install-Module -Name ContosoServer -RequiredVersion 1.5 -Scope CurrentUser +Get-InstalledModule +Get-Module -ListAvailable ContosoServer +Get-InstalledScript ContosoServer | Format-List * + +Install-Module -Name ContosoClient -RequiredVersion 1.0 -Scope CurrentUser +Get-InstalledModule ContosoClient +Get-Module -ListAvailable ContosoClient + +Update-Module ContosoClient -RequiredVersion 1.5 +Get-InstalledModule ContosoClient +Get-Module -ListAvailable ContosoClient + +Update-Module -WhatIf +Update-Module +Get-InstalledModule + +Get-InstalledModule ContosoClient -AllVersions +Uninstall-Module ContosoClient -RequiredVersion 1.0 +Get-InstalledModule ContosoClient -AllVersions + + +Find-Script +Find-Script -Name Fabrikam-ServerScript +Save-Script Fabrikam-ServerScript -Path /tmp +Get-ChildItem -Path /tmp/Fabrikam-ServerScript.ps1 + +'/tmp/Fabrikam-ServerScript.ps1' + +Find-Script -Name Fabrikam-ServerScript -RequiredVersion 2.0 | Install-Script -Scope CurrentUser +Get-InstalledScript + +Install-Script Fabrikam-ServerClient -RequiredVersion 1.0 -Scope CurrentUser +Get-InstalledScript + +Get-InstalledScript Fabrikam-ServerClient | Format-List * + +Update-Script -WhatIf +Update-Script +Get-InstalledScript + +Uninstall-Script Fabrikam-ServerClient -Verbose + + + From 1889ab18c5db067ffc7b77eabab6d47cf361fede Mon Sep 17 00:00:00 2001 From: Manikyam Bavandla Date: Wed, 20 Jul 2016 18:35:52 -0700 Subject: [PATCH 2/2] Updating PowerShellGet demo --- demos/PowerShellGet.ps1 | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/demos/PowerShellGet.ps1 b/demos/PowerShellGet.ps1 index 2dae82871..e2c15cc38 100644 --- a/demos/PowerShellGet.ps1 +++ b/demos/PowerShellGet.ps1 @@ -2,10 +2,6 @@ Get-PSRepository -Register-PSRepository -Name PSGalleryINT -SourceLocation https://dtlgalleryint.cloudapp.net -InstallationPolicy Trusted - -Get-PSRepository - Find-Module Find-Module ContosoServer @@ -15,7 +11,7 @@ Get-ChildItem -Path /tmp/ContosoServer -Recurse Install-Module -Name ContosoServer -RequiredVersion 1.5 -Scope CurrentUser Get-InstalledModule Get-Module -ListAvailable ContosoServer -Get-InstalledScript ContosoServer | Format-List * +Get-InstalledModule ContosoServer | Format-List * Install-Module -Name ContosoClient -RequiredVersion 1.0 -Scope CurrentUser Get-InstalledModule ContosoClient