PowerShell class Null safety

Windows Power Shell

Mixed in types

Constructors

PowerShell.withPid(int? pid)
Attached to the Powershell shell with the given pid.

Properties

canModifyPath bool
Returns true if this shell supports modifying the shell's PATH
read-onlyinherited
hashCode int
The hash code for this object.
read-onlyoverride
hasStartScript bool
True if this shell supports a start script or configuration file. e.g. a script that is run by the shell or a configuration file that is read when the shell starts.
read-onlyoverride
installInstructions String
Returns the instructions to install DCli.
read-onlyinherited
isCompletionInstalled bool
read-onlyoverride
isCompletionSupported bool
read-onlyoverride
isPrivilegedPasswordRequired bool
Returns true if running a privileged action woulduser cause a password to be requested.
read-onlyinherited
isPrivilegedProcess bool
Returns true if the current process is running with elevated privileges e.g. Is running as an Administrator.
read-onlyinherited
isPrivilegedUser bool
Returns true if the current process is running with elevated privileges e.g. Is running as an Administrator.
read-onlyinherited
isSudo bool
On Windows this is always false.
read-onlyinherited
loggedInUser String?
read-onlyinherited
loggedInUsersHome String
Attempts to retrive the logged in user's home directory.
read-onlyinherited
name String
The name of the shell e.g. bash
read-onlyoverride
pathToStartScript String
Returns the path to the shell's start script or config file e.g /home/
read-onlyoverride
pid int?
The pid of the current shell
final
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
startScriptName String
Returns the name of the shell's startup script or configuration file e.g. .bashrc
read-onlyoverride

Methods

addFileAssocation(String dcliPath) → void
Called during the install so that an OS that needs to create a file association between .dart and dcli can create that association. The implementor is responsible for not adding the association if it already exists.
override
addFileAssociation(String dcliPath) → void
Add a file association so that typing the name of a dart script on the cli launches dcli which in turn launches the script.
inherited
addFileAssociationv2() → void
Add a file association so that typing the name of a dart script on the cli launches dcli which in turn launches the script.
inherited
addToPATH(String path) bool
Adds a path to the start script returns true if adding the path was successful
override
appendToPATH(String path) bool
Appends path to the end of the PATH by updating the Windows Registry. We update the user's PATH (HKEY_CURRENT_USER) rather than the system path so this change will only affect the logged in user.
inherited
checkInstallPreconditions() String?
Check if the shell has any notes re: pre-isntallation conditions.
inherited
inDeveloperMode() bool
Windows 10+ has a developer mode that needs to be enabled to create symlinks without escalated prividedges. For details on enabling dev mode on windows see: https://dcli.onepub.dev/getting-started/installing-on-windows
inherited
install({bool installDart = true, bool activate = true}) bool
Called to install the windows specific dart/dcli components.
inherited
installTabCompletion({bool quiet = false}) → void
If the shell supports tab completion then install it. If quiet is true then suppress any console output except for errors.
override
matchByName(String name) bool
Returns true if the shells name matches the passed name. The comparison is case insensitive.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
prependToPATH(String path) bool
Prepend path to the end of the PATH by updating the Windows Registry. We update the user's PATH (HKEY_CURRENT_USER) rather than the system path so this change will only affect the logged in user.
inherited
privilegesRequiredMessage(String app) String
inherited
releasePrivileges() → void
NO OP under windows
inherited
restorePrivileges() → void
NO OP under windows
inherited
toString() String
A string representation of this object.
inherited
withPrivileges(RunPrivileged action, {bool allowUnprivileged = false}) → void
Run action with root UID and gid
inherited

Operators

operator ==(covariant PowerShell other) bool
The equality operator.
override

Constants

shellName → const String
Name of the shell
'powershell.exe'