Set–KubectlShell - anongitmous/k8sShell GitHub Wiki

Set or change the value of the default shell to use.

Syntax

Set-KubectlShell

[-KubectlShell] <String>
[<CommonParameters>]

Description

Set the cluster-agnostic (i.e. global) shell to use (displays as 'KubectlShell' in the output if -PassThru is specified).

This will override any value already extant in the current session.

Each cluster configuration supports having independent default shells to use. e.g. cluster1 could have its default shell be '/bin/sh' while cluster2 could have its default shell be '/bin/bash'.

If it is neither the case that a given cluster config defines a default shell nor that an explicit shell is passed to a cmdlet that accepts a shell argument, then the value specified by the -KubectlShell argument to this cmdlet will be used.

There are two cmdlets that can make use of this value:

See the example output.

Examples

ℹ️ See A Note about the Examples

1. Set the default shell to use to be '/bin/bash'

Set-KubectlShell '/bin/bash'

  • To see the updated value, add the -PassThru switch parameter.
  • Using aliasing, the above can be shortened to
    kssks '/bin/bash'

Parameters

-KubectlShell

  • The shell which e.g. Start–KubectlExec will use if one is not defined for the active cluster config and is not specified explicitly to the cmdlet.
Type: <String>
Aliases:
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-PassThru

  • Switch parameter that controls whether the updated runtime configuration is output to the console.
Type: SwitchParameter
Aliases:
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

Outputs

Mtf.Kubernetes.Config.RuntimeConfiguration

Example

image

Notes

K8sShell includes the following alias for Set-KubectlShell:

  • kssks

Related

⚠️ **GitHub.com Fallback** ⚠️