Skip to content

Commit a288ba9

Browse files
committed
aliases
1 parent ec1ec3b commit a288ba9

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

gridshell.psd1

+4-2
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@
7575

7676
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
7777
FunctionsToExport = @(
78+
"Connect-G5KUser",
79+
"Disconnect-G5KUser",
7880
"Get-G5KApiRoot",
7981
"Get-G5KGroup",
8082
"Get-G5KGroupMembers",
@@ -102,7 +104,6 @@
102104
"Remove-OarJob",
103105
"Select-OarNode",
104106
"Set-G5KApiRoot",
105-
"Set-GridshellCurrentCredential",
106107
"Set-GridshellCurrentSite",
107108
"Set-OarJobWalltime",
108109
"Start-KaDeployment",
@@ -119,9 +120,10 @@
119120

120121
# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
121122
AliasesToExport = @(
122-
"Connect-G5KUser",
123+
"Get-OarCurrentSite",
123124
"New-KaDeployment",
124125
"Remove-KaDeployment",
126+
"Set-OarCurrentSite",
125127
"Start-OarJob",
126128
"Stop-OarJob"
127129
)

private/Detect.ps1

+11-4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ function Get-GridshellCurrentSite {
2020
return $script:currentSite
2121
}
2222
Export-ModuleMember -Function Get-GridshellCurrentSite
23+
New-Alias -Name Get-OarCurrentSite -Value Get-GridshellCurrentSite
24+
Export-ModuleMember -Alias Get-OarCurrentSite
2325

2426
function Set-GridshellCurrentSite {
2527
[CmdletBinding(DefaultParameterSetName = "Value")]
@@ -37,8 +39,10 @@ function Set-GridshellCurrentSite {
3739
$script:currentSite = $Site
3840
}
3941
Export-ModuleMember -Function Set-GridshellCurrentSite
42+
New-Alias -Name Set-OarCurrentSite -Value Set-GridshellCurrentSite
43+
Export-ModuleMember -Alias Set-OarCurrentSite
4044

41-
function Set-GridshellCurrentCredential {
45+
function Connect-G5KUser {
4246
[CmdletBinding(DefaultParameterSetName = "Value")]
4347
param(
4448
[Parameter(Mandatory, Position = 0, ParameterSetName = "Value")]
@@ -51,6 +55,9 @@ function Set-GridshellCurrentCredential {
5155
}
5256
$script:currentCredential = $Credential
5357
}
54-
Export-ModuleMember -Function Set-GridshellCurrentCredential
55-
New-Alias -Name Connect-G5KUser -Value Set-GridshellCurrentCredential
56-
Export-ModuleMember -Alias Connect-G5KUser
58+
Export-ModuleMember -Function Connect-G5KUser
59+
60+
function Disconnect-G5KUser {
61+
$script:currentCredential = $null
62+
}
63+
Export-ModuleMember -Function Disconnect-G5KUser

private/Selector.ps1

+3-5
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class G5KSelectorOr : System.Collections.Generic.List[object] {
2929
function Select-OarNode {
3030
<#
3131
.SYNOPSIS
32-
Create or extend an OAR resource selector using a list of specifiers.
32+
Create or extend an OAR resource selector using the given specifiers.
3333
#>
3434
[CmdletBinding()]
3535
param(
@@ -127,8 +127,8 @@ function Select-OarNode {
127127
# The full hostname of the node the resource is part of.
128128
[Parameter()][string]$HostName,
129129

130-
# Custom specifiers to include.
131-
[Parameter()][string[]]$CustomExpressions,
130+
# Additional specifiers to include.
131+
[Parameter()][string[]]$Filters,
132132
# List resources belonging to this selector with `oarnodes`.
133133
[Parameter()][switch]$List
134134
)
@@ -231,9 +231,7 @@ function Select-OarNode {
231231
elseif ($IsAlive) {
232232
$expr.Add("(state='Alive')")
233233
}
234-
# The full hostname of the node the resource is part of.
235234
if (![string]::IsNullOrEmpty($HostName)) {
236-
# The full hostname of the node the resource is part of.
237235
$expr.Add("(lower(host) like lower('$HostName'))")
238236
}
239237

0 commit comments

Comments
 (0)