< Back
Find-ODUVariable
Post
NAME Find-ODUVariable
SYNOPSIS
Find variables by name or value in Octopus Deploy latest export
SYNTAX
Find-ODUVariable [-SearchText] <String> [-Exact] [-WriteOutput] [-PSObject] [<CommonParameters>]
DESCRIPTION
Find variables by name or value in Octopus Deploy latest export. Matches either partial
text or Exact. Uses latest available export for searching. When first running, captures
oduobject and stores it in global scope variable $ODU_Export. Future searches will use the
$ODU_Export to speed up the search process. If a new export becomes available after
$ODU_Export was captured, it loads that new export into memory and caches it.
PARAMETERS
-SearchText <String>
Variable name or value to search for; can be partial text
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Exact [<SwitchParameter>]
Return only exact matches
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-WriteOutput [<SwitchParameter>]
Instead of using Write-Host to produced highlightened content, use only Write-Output
(prevents colors but also allows for storing search results in files via > file.txt
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-PSObject [<SwitchParameter>]
Instead of writing any output to host, return search results as a PSObject. Useful
for programmatic usage of search results.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>Find-ODUVariable SalesDb
<outputs to host all variables that contain 'SalesDb' in name and / or value>
-------------------------- EXAMPLE 2 --------------------------
PS C:\\>oduvar SalesDb
<same as previous example but uses alias>
-------------------------- EXAMPLE 3 --------------------------
PS C:\\>Find-ODUVariable SalesDb -Exact
<outputs to host all variables with exact name and / or exact value of 'SalesDb'>
-------------------------- EXAMPLE 4 --------------------------
Find-ODUVariable SalesDb -WriteOutput >c:\\temp\\Results.txt
<outputs to standard output all variables that contain 'SalesDb' in name and / or value, save to file>
-------------------------- EXAMPLE 5 --------------------------
PS C:\\>Find-ODUVariable SalesDb -PSObject
<returns PSObject with search results, can be used for more detailed analyis or a part of another search tool>
RELATED LINKS
https://github.com/DTW-DanWard/OctopusDeployUtilities
SYNOPSIS
Find variables by name or value in Octopus Deploy latest export
SYNTAX
Find-ODUVariable [-SearchText] <String> [-Exact] [-WriteOutput] [-PSObject] [<CommonParameters>]
DESCRIPTION
Find variables by name or value in Octopus Deploy latest export. Matches either partial
text or Exact. Uses latest available export for searching. When first running, captures
oduobject and stores it in global scope variable $ODU_Export. Future searches will use the
$ODU_Export to speed up the search process. If a new export becomes available after
$ODU_Export was captured, it loads that new export into memory and caches it.
PARAMETERS
-SearchText <String>
Variable name or value to search for; can be partial text
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Exact [<SwitchParameter>]
Return only exact matches
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-WriteOutput [<SwitchParameter>]
Instead of using Write-Host to produced highlightened content, use only Write-Output
(prevents colors but also allows for storing search results in files via > file.txt
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-PSObject [<SwitchParameter>]
Instead of writing any output to host, return search results as a PSObject. Useful
for programmatic usage of search results.
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>Find-ODUVariable SalesDb
<outputs to host all variables that contain 'SalesDb' in name and / or value>
-------------------------- EXAMPLE 2 --------------------------
PS C:\\>oduvar SalesDb
<same as previous example but uses alias>
-------------------------- EXAMPLE 3 --------------------------
PS C:\\>Find-ODUVariable SalesDb -Exact
<outputs to host all variables with exact name and / or exact value of 'SalesDb'>
-------------------------- EXAMPLE 4 --------------------------
Find-ODUVariable SalesDb -WriteOutput >c:\\temp\\Results.txt
<outputs to standard output all variables that contain 'SalesDb' in name and / or value, save to file>
-------------------------- EXAMPLE 5 --------------------------
PS C:\\>Find-ODUVariable SalesDb -PSObject
<returns PSObject with search results, can be used for more detailed analyis or a part of another search tool>
RELATED LINKS
https://github.com/DTW-DanWard/OctopusDeployUtilities