devblackops / NetScaler

PowerShell module for interacting with Citrix NetScaler via the Nitro API
Apache License 2.0
69 stars 32 forks source link

Corrected typos in license installation and service group creation #2

Closed dbroeglin closed 8 years ago

dbroeglin commented 8 years ago

This pull requests corrects a couple of simple typos that prevented the commands from working.

devblackops commented 8 years ago

Awesome work! Thanks for fixing my typos :) I noticed you added an additional function Invoke-Nitro in the .psd1 but I don't see any function included in the PR. What does that function do?

dbroeglin commented 8 years ago

My bad, it is a slightly modified version of _InvokeNSRestApi but public. I removed it.

There are lots of Nitro features that are not implemented in the module so I used it to prototype them in my own script.

devblackops commented 8 years ago

No problem. If you have any other functions that implement more Nitro features, you're more than welcome to add them.

dbroeglin commented 8 years ago

Hello!

I will send you what I cobble together. I’m a bit worried though. The module takes quite some time to load (I’m using PS 5.0 and it takes about 30s). If we keep adding cmdlets will it be even longer ?

In the meantime, I copied the _InvokeNSRestApi.ps1 into a Invoke-Nitro cmdlet. It allows for quick prototyping of other calls. Would you be OK to make _InvokeNSRestApi.ps1 public in that way ?

Best regards, Dominique

On 03 Apr 2016, at 17:55, Brandon Olin notifications@github.com wrote:

No problem. If you have any other functions that implement more Nitro features, you're more than welcome to add them.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/devblackops/NetScaler/pull/2#issuecomment-205003131

iainbrighton commented 8 years ago

Any publicly exposed functions should follow the standard verb-noun (singular) convention. As long as it's appropriately documented for advanced use cases I don't foresee an issue. Not following this would generate warning on module load.

You might want to raise a separate issue for the long load time. This doesn't sound normal and needs to be addressed. Can you repro this on another machine?

devblackops commented 8 years ago

I'd be generally OK with making a public version of _InvokeNSRestApi but like @iainbrighton said, it would need to follow the proper verb-noun format and have the appropriate documentation. It would also need to support -WhatIf and -Confirm or -Force for PUT, POST, and DELETE operations as a safety mechanism. Without that, it would be too easy to shoot yourself in the foot.

Re: Module loading time. Please put in a separate issue for that. I haven't seen an issue with loading time for this module. Can you wrap the Import-Module in Measure-Command as well and put that in the issue?

dbroeglin commented 8 years ago

Hello!

Here a run on the said machine: PS Automating_NSConf> Measure-Command { import-module Netscaler -Force -Verbose } VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\Netscaler\Netscaler.psd1'. VERBOSE: Removing the imported "Set-NSTimeZone" function. VERBOSE: Removing the imported "Set-NSLBVirtualServer" function. VERBOSE: Removing the imported "Set-NSLBServiceGroup" function. VERBOSE: Removing the imported "Set-NSLBServer" function. VERBOSE: Removing the imported "Set-NSHostname" function. VERBOSE: Removing the imported "Save-NSConfig" function. VERBOSE: Removing the imported "Restart-NetScaler" function. VERBOSE: Removing the imported "Remove-NSLBVirtualServerBinding" function. VERBOSE: Removing the imported "Remove-NSLBVirtualServer" function. VERBOSE: Removing the imported "Remove-NSLBServiceGroup" function. VERBOSE: Removing the imported "Remove-NSLBServer" function. VERBOSE: Removing the imported "Remove-NSLBMonitor" function. VERBOSE: Removing the imported "New-NSLBVirtualServer" function. VERBOSE: Removing the imported "New-NSLBServiceGroupMember" function. VERBOSE: Removing the imported "New-NSLBServiceGroup" function. VERBOSE: Removing the imported "New-NSLBServer" function. VERBOSE: Removing the imported "New-NSLBMonitor" function. VERBOSE: Removing the imported "Invoke-Nitro" function. VERBOSE: Removing the imported "Install-NSLicense" function. VERBOSE: Removing the imported "Get-NSMode" function. VERBOSE: Removing the imported "Get-NSLBVirtualServerBinding" function. VERBOSE: Removing the imported "Get-NSLBVirtualServer" function. VERBOSE: Removing the imported "Get-NSLBStat" function. VERBOSE: Removing the imported "Get-NSLBServiceGroupMemberBinding" function. VERBOSE: Removing the imported "Get-NSLBServiceGroup" function. VERBOSE: Removing the imported "Get-NSLBServer" function. VERBOSE: Removing the imported "Get-NSLBMonitor" function. VERBOSE: Removing the imported "Get-NSHostname" function. VERBOSE: Removing the imported "Get-NSFeature" function. VERBOSE: Removing the imported "Get-NSAvailableTimeZone" function. VERBOSE: Removing the imported "Enable-NSMode" function. VERBOSE: Removing the imported "Enable-NSLBVirtualServer" function. VERBOSE: Removing the imported "Enable-NSLBServer" function. VERBOSE: Removing the imported "Enable-NSLBMonitor" function. VERBOSE: Removing the imported "Enable-NSFeature" function. VERBOSE: Removing the imported "Disconnect-NetScaler" function. VERBOSE: Removing the imported "Disable-NSMode" function. VERBOSE: Removing the imported "Disable-NSLBVirtualServer" function. VERBOSE: Removing the imported "Disable-NSLBServer" function. VERBOSE: Removing the imported "Disable-NSLBMonitor" function. VERBOSE: Removing the imported "Disable-NSFeature" function. VERBOSE: Removing the imported "Connect-NetScaler" function. VERBOSE: Removing the imported "Add-NSServerCertificate" function. VERBOSE: Removing the imported "Add-NSRSAKey" function. VERBOSE: Removing the imported "Add-NSLBVirtualServerBinding" function. VERBOSE: Removing the imported "Add-NSIPResource" function. VERBOSE: Removing the imported "Add-NSDnsNameServer" function. VERBOSE: Removing the imported "Add-NSCertKeyPair" function. VERBOSE: Loading module from path 'C:\Program Files\WindowsPowerShell\Modules\Netscaler\NetScaler.psm1'. VERBOSE: Exporting function 'Add-NSCertKeyPair'. VERBOSE: Exporting function 'Add-NSDnsNameServer'. VERBOSE: Exporting function 'Add-NSIPResource'. VERBOSE: Exporting function 'Add-NSLBVirtualServerBinding'. VERBOSE: Exporting function 'Add-NSRSAKey'. VERBOSE: Exporting function 'Add-NSServerCertificate'. VERBOSE: Exporting function 'Connect-NetScaler'. VERBOSE: Exporting function 'Disable-NSFeature'. VERBOSE: Exporting function 'Disable-NSLBMonitor'. VERBOSE: Exporting function 'Disable-NSLBServer'. VERBOSE: Exporting function 'Disable-NSLBVirtualServer'. VERBOSE: Exporting function 'Disable-NSMode'. VERBOSE: Exporting function 'Disconnect-NetScaler'. VERBOSE: Exporting function 'Enable-NSFeature'. VERBOSE: Exporting function 'Enable-NSLBMonitor'. VERBOSE: Exporting function 'Enable-NSLBServer'. VERBOSE: Exporting function 'Enable-NSLBVirtualServer'. VERBOSE: Exporting function 'Enable-NSMode'. VERBOSE: Exporting function 'Get-NSAvailableTimeZone'. VERBOSE: Exporting function 'Get-NSFeature'. VERBOSE: Exporting function 'Get-NSHostname'. VERBOSE: Exporting function 'Get-NSLBMonitor'. VERBOSE: Exporting function 'Get-NSLBServer'. VERBOSE: Exporting function 'Get-NSLBServiceGroup'. VERBOSE: Exporting function 'Get-NSLBServiceGroupMemberBinding'. VERBOSE: Exporting function 'Get-NSLBStat'. VERBOSE: Exporting function 'Get-NSLBVirtualServer'. VERBOSE: Exporting function 'Get-NSLBVirtualServerBinding'. VERBOSE: Exporting function 'Get-NSMode'. VERBOSE: Exporting function 'Install-NSLicense'. VERBOSE: Exporting function 'Invoke-Nitro'. VERBOSE: Exporting function 'New-NSLBMonitor'. VERBOSE: Exporting function 'New-NSLBServer'. VERBOSE: Exporting function 'New-NSLBServiceGroup'. VERBOSE: Exporting function 'New-NSLBServiceGroupMember'. VERBOSE: Exporting function 'New-NSLBVirtualServer'. VERBOSE: Exporting function 'Remove-NSLBMonitor'. VERBOSE: Exporting function 'Remove-NSLBServer'. VERBOSE: Exporting function 'Remove-NSLBServiceGroup'. VERBOSE: Exporting function 'Remove-NSLBVirtualServer'. VERBOSE: Exporting function 'Remove-NSLBVirtualServerBinding'. VERBOSE: Exporting function 'Restart-NetScaler'. VERBOSE: Exporting function 'Save-NSConfig'. VERBOSE: Exporting function 'Set-NSHostname'. VERBOSE: Exporting function 'Set-NSLBServer'. VERBOSE: Exporting function 'Set-NSLBServiceGroup'. VERBOSE: Exporting function 'Set-NSLBVirtualServer'. VERBOSE: Exporting function 'Set-NSTimeZone'. VERBOSE: Exporting function '_AssertSessionActive'. VERBOSE: Exporting function '_InvokeNSRestApi'. VERBOSE: Importing function 'Add-NSCertKeyPair'. VERBOSE: Importing function 'Add-NSDnsNameServer'. VERBOSE: Importing function 'Add-NSIPResource'. VERBOSE: Importing function 'Add-NSLBVirtualServerBinding'. VERBOSE: Importing function 'Add-NSRSAKey'. VERBOSE: Importing function 'Add-NSServerCertificate'. VERBOSE: Importing function 'Connect-NetScaler'. VERBOSE: Importing function 'Disable-NSFeature'. VERBOSE: Importing function 'Disable-NSLBMonitor'. VERBOSE: Importing function 'Disable-NSLBServer'. VERBOSE: Importing function 'Disable-NSLBVirtualServer'. VERBOSE: Importing function 'Disable-NSMode'. VERBOSE: Importing function 'Disconnect-NetScaler'. VERBOSE: Importing function 'Enable-NSFeature'. VERBOSE: Importing function 'Enable-NSLBMonitor'. VERBOSE: Importing function 'Enable-NSLBServer'. VERBOSE: Importing function 'Enable-NSLBVirtualServer'. VERBOSE: Importing function 'Enable-NSMode'. VERBOSE: Importing function 'Get-NSAvailableTimeZone'. VERBOSE: Importing function 'Get-NSFeature'. VERBOSE: Importing function 'Get-NSHostname'. VERBOSE: Importing function 'Get-NSLBMonitor'. VERBOSE: Importing function 'Get-NSLBServer'. VERBOSE: Importing function 'Get-NSLBServiceGroup'. VERBOSE: Importing function 'Get-NSLBServiceGroupMemberBinding'. VERBOSE: Importing function 'Get-NSLBStat'. VERBOSE: Importing function 'Get-NSLBVirtualServer'. VERBOSE: Importing function 'Get-NSLBVirtualServerBinding'. VERBOSE: Importing function 'Get-NSMode'. VERBOSE: Importing function 'Install-NSLicense'. VERBOSE: Importing function 'Invoke-Nitro'. VERBOSE: Importing function 'New-NSLBMonitor'. VERBOSE: Importing function 'New-NSLBServer'. VERBOSE: Importing function 'New-NSLBServiceGroup'. VERBOSE: Importing function 'New-NSLBServiceGroupMember'. VERBOSE: Importing function 'New-NSLBVirtualServer'. VERBOSE: Importing function 'Remove-NSLBMonitor'. VERBOSE: Importing function 'Remove-NSLBServer'. VERBOSE: Importing function 'Remove-NSLBServiceGroup'. VERBOSE: Importing function 'Remove-NSLBVirtualServer'. VERBOSE: Importing function 'Remove-NSLBVirtualServerBinding'. VERBOSE: Importing function 'Restart-NetScaler'. VERBOSE: Importing function 'Save-NSConfig'. VERBOSE: Importing function 'Set-NSHostname'. VERBOSE: Importing function 'Set-NSLBServer'. VERBOSE: Importing function 'Set-NSLBServiceGroup'. VERBOSE: Importing function 'Set-NSLBVirtualServer'. VERBOSE: Importing function 'Set-NSTimeZone'.

Days : 0 Hours : 0 Minutes : 0 Seconds : 18 Milliseconds : 608 Ticks : 186082787 TotalDays : 0.000215373596064815 TotalHours : 0.00516896630555556 TotalMinutes : 0.310137978333333 TotalSeconds : 18.6082787 TotalMilliseconds : 18608.2787

It varies a great deal, this being one of the quickest. It is on a Win7 with PowerShell 4.0.

On a Win 10 VM on my laptop I get a ~2s loading time.

I will make more tests and see if I can reproduce it on another box before opening an issue.

Best regards, Dominique

On 04 Apr 2016, at 22:25, Iain Brighton notifications@github.com wrote:

Any publicly exposed functions should follow the standard verb-noun (singular) convention. As long as it's appropriately documented for advanced use cases I don't foresee an issue. Not following this would generate warning on module load.

You might want to raise a separate issue for the long load time. This doesn't sound normal and needs to be addressed. Can you repro this on another machine? — You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/devblackops/NetScaler/pull/2#issuecomment-205479344