PowerShell is a task automation and configuration management framework from Microsoft, consisting of a command-line shell and associated scripting language. The is a set of PowerShell commands that allow ºÚÁϺ£½Ç91Èë¿Ú administrators to interact with their ºÚÁϺ£½Ç91Èë¿Ú directory.
Installing the ºÚÁϺ£½Ç91Èë¿Ú PowerShell module can be done by running a single command.
On Mac or Linux and need to install PowerShell? See Installing PowerShell on Mac and Linux below.
Installing the PowerShell Module
From a Windows PowerShell window launched as administrator, or a terminal window on Mac and Linux where you have launched in PowerShell by running the command pwsh
, enter the command:
Install-Module ºÚÁϺ£½Ç91Èë¿Ú -Scope CurrentUser
When prompted, press Y to install the ºÚÁϺ£½Ç91Èë¿Ú PowerShell module:
Untrusted repository You are installing the modules from an untrusted repository. If you trust this repository, change its InstallationPolicy value by running the Set-PSRepository cmdlet. Are you sure you want to install the modules from 'PSGallery'? [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"):
Authenticating the PowerShell Module
After the ºÚÁϺ£½Ç91Èë¿Ú module is installed, you will authenticate the module to the ºÚÁϺ£½Ç91Èë¿Ú API using a ºÚÁϺ£½Ç91Èë¿Ú API key and the function .
Locate your ºÚÁϺ£½Ç91Èë¿Ú API key within the ºÚÁϺ£½Ç91Èë¿Ú Admin Portal. Need help finding your ºÚÁϺ£½Ç91Èë¿Ú API key? See ºÚÁϺ£½Ç91Èë¿Ú APIs.
After locating your ºÚÁϺ£½Ç91Èë¿Ú API key, enter the command Connect-JCOnline
and enter your API key when prompted. Example:
/Users/buster>
Connect-JCOnline cmdlet Connect-JCOnline at command pipeline position 1 Supply values for the following parameters: (Type !? for Help.)
ºÚÁϺ£½Ç91Èë¿ÚAPIKey:
On Mac or Linux? Once PowerShell is installed, remember you must enter the pwsh
command within the terminal application to open PowerShell.
A success message will indicate that you have successfully connected to the module. If there is an update available for the module, you will be asked if you would like to update.
Using PowerShell
Find a matrix of copy-and-pastable real work PowerShell examples that have been crowd sourced from ºÚÁϺ£½Ç91Èë¿Ú customers within the .
To see all of the available commands within the ºÚÁϺ£½Ç91Èë¿Ú Module, run:
Get-Command -Module ºÚÁϺ£½Ç91Èë¿Ú
Accessing Built-In Help
PowerShell has a built-in help system. To use this system, type Help [enter command here] -Full
to see the full help inside the terminal. For example:
Help Get-JCUser -Full
Or, run Help [enter command here] -Online
to see the help in a web browser:
Help Get-JCUser -Online
If you get stuck inside the internal help, press Q to exit.
Installing PowerShell on Mac and Linux
If you are on Mac or Linux, follow to locate the PowerShell package for your operating system.
Download the installation media by clicking on the hyperlink next to your operating system under the Downloads (stable) column of the linked table.
Install the PowerShell application on your target system using the downloaded installation media.
Need more help? Navigate to the How to Install Instructions link for your operating system in the linked table.
Once PowerShell is installed, PowerShell can be accessed within the terminal application on Mac or Linux system by typing pwsh
.
MBP-d3v:~ scottd3v$ pwsh
PowerShell v7.0.0
Copyright (c) Microsoft Corporation. All rights reserved.
https://aka.ms/pscore6-docs
Type 'help' to get help.
PS /Users/scottd3v>
You will be able to tell you are running PowerShell because the root of your terminal command line will switch to PS
as seen above.
- Before calling PowerShell using the
pwsh
command:MBP-d3v:~ scottd3v$
- After:
PS /Users/scottd3v
Uninstalling the PowerShell Module
When the command "Install-module" is used to install a module from the PowerShell gallery, the contents of the module are saved locally to the system.
To uninstall a module and ensure a clean full uninstallation, remove the module files from the system.
The command "Get-InstaledModule" and the property "InstalledLocation" can be used to query the location of the module files on a system. See the below examples:
Mac
Get-InstalledModule ºÚÁϺ£½Ç91Èë¿Ú | Select-Object InstalledLocation
InstalledLocation
-----------------
/Users/buster/.local/share/powershell/Modules/ºÚÁϺ£½Ç91Èë¿Ú/1.12.0
Windows
Get-InstalledModule ºÚÁϺ£½Ç91Èë¿Ú | Select-Object InstalledLocation
InstalledLocation
-----------------
C:\Users\buster\Documents\WindowsPowerShell\Modules\ºÚÁϺ£½Ç91Èë¿Ú\1.11.0
Removing the folder "ºÚÁϺ£½Ç91Èë¿Ú" and its contents from the system will uninstall the module and allow for a clean reinstallation using the "Install-Module" command.
Troubleshooting
In order to install the ºÚÁϺ£½Ç91Èë¿Ú PowerShell Module from the PowerShell gallery on Windows, you must be running Windows PowerShell version 5.0 or newer and have your Execution Policy set to at least RemoteSigned.
The PowerShell command $PSVersionTable
will show what version of PowerShell is installed on a local machine. PSVersion
will reveal the version number when using this command:
$PSVersionTable
Name Value
---- -----
PSVersion 5.1.16299.64
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.16299.64
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
On Windows machines, the Execution Policy must be set to at least RemoteSigned in order to load the module. The module will install if the Execution Policy is set to Unrestricted or ByPass as well. To see the Execution Policy, run the command Get-ExecutionPolicy
. To set the Execution Policy, run the following command in a Windows PowerShell session launched with Administrator permissions:
Set-ExecutionPolicy RemoteSigned