is-admin
for core> is-admin {flags}
input | output |
---|---|
nothing | bool |
Return 'iamroot' if nushell is running with admin/root privileges, and 'iamnotroot' if not.
>if (is-admin) { "iamroot" } else { "iamnotroot" }
iamnotroot
Copyright © 2019–2023 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/is-admin.html