is-admin for core

Check if nushell is running with administrator or root privileges.

Signature

> is-admin {flags}

Input/output types:

inputoutput
nothingbool

Examples

Return 'iamroot' if nushell is running with admin/root privileges, and 'iamnotroot' if not.

> if (is-admin) { "iamroot" } else { "iamnotroot" }
iamnotroot