If the module is not installed, or if it is installed incorrectly, the Get-Module command for this recipe outputs nothing. If this occurs, that the Splunk module is available in your PowerShell module path. See Also Get-Help about_modules Get-Help Get-Module Import the Splunk Module on page 7. Import the Splunk Module Problem You want to import the Splunk module into your existing PowerShell session to enable Splunk management and search features. Solution Use the built-in Import-Module PowerShell cmdlet to import the Splunk module. PS > Import-Module Splunk –Name Discussion The Splunk PowerShell Resource Kit is distributed as a PowerShell module named In order to “Splunk.” make use of the module features, this module must be imported into your current PowerShell session. The Import-Module cmdlet takes the name of the module to import as the parameter. Once this –Name Import-Module cmdlet is executed, the Splunk PowerShell Resource Kit cmdlets are available during your PowerShell session. Note: To import the Splunk PowerShell module into your environment, place the contents of the module directory into your PowerShell module directory. See Also Get-Help about_modules Get-Help Import-Module Query the Splunk Module Features Problem You want to see what commands are available in the Splunk module. Solution Use the Splunk module command Get-Splunk to retrieve a list of available module cmdlets. PS > Get-Splunk CommandType Name Definition ----------- ---- ----------
If the module is not installed, or if it is installed incorrectly, the Get-Module command for this recipe outputs nothing. If this occurs, that the Splunk module is available in your PowerShell module path. See Also Get-Help about_modules Get-Help Get-Module Import the Splunk Module on page 7. Import the Splunk Module Problem You want to import the Splunk module into your existing PowerShell session to enable Splunk management and search features. Solution Use the built-in Import-Module PowerShell cmdlet to import the Splunk module. PS > Import-Module –Name Splunk Discussion The Splunk PowerShell Resource Kit is distributed as a PowerShell module named “Splunk.” In order to make use of the module features, this module must be imported into your current PowerShell session. The Import-Module cmdlet takes the name of the module to import as the –Name parameter. Once this Import-Module cmdlet is executed, the Splunk PowerShell Resource Kit cmdlets are available during your PowerShell session. Note: To import the Splunk PowerShell module into your environment, place the contents of the module directory into your PowerShell module directory. See Also Get-Help about_modules Get-Help Import-Module Query the Splunk Module Features Problem You want to see what commands are available in the Splunk module. Solution Use the Splunk module command Get-Splunk to retrieve a list of available module cmdlets. PS > Get-Splunk CommandType Name Definition ----------- ---- ----------
Splunk%20PowerShell%20Resource%20Kit.docx