Skip to main content
Skip table of contents

Use PowerShell to connect to the PeerGFS API

Applies to PeerGFS v4.6.0.20210402 and later.

Initializing the Toolkit

  1. Open Peer Management Center.
  2. Open Preferences, select General Configurationand then select Web and API Configuration
  3. Enable the Enable HTTPS REST API using port: 8442 option.

  4. Click Apply and Close.
  5. Launch PowerShell and navigate to <PMC Installation Directory>\tools\powershell on the PMC server.
  6. Run .\ConfigurePeerGFSToolkit.ps1 from the PowerShell console.
  7. Start using the API.  See command examples below.

Example Commands

Sample PowerShell Calls

# List all Agents
$agents = Get-PeerGFSAgents
$agents.Agents | fl

# List all Jobs
$jobList = Get-PeerGFSJobs
$ | fl

# List all open files
$openFiles = Get-PeerGFSOpenFiles
$openFiles.openFiles | ft

# List all quarantines
$quarantines = Get-PeerGFSConflicts -FileConflictTypes QUARANTINED
$quarantines.FileConflicts | ft

# List watch set statistics
$watchSetStats = Get-PeerGFSWatchSetStats
$watchSetStats.watchSetStats | ft

# List active open and pending replication stats
$activeStats = Get-PeerGFSActiveStats
$activeStats.activeStats | ft

# List queue stats
$queueStats = Get-PeerGFSQueueStats
$queueStats.fileQueueStats | ft

# List stats about replication work that is already complete
$replStats = Get-PeerGFSReplicationStats
$replStats.replicationStats | ft

# List scan status and stats
$scanStatus = Get-PeerGFSScanStatus
$scanStatus.fileScanStatuses | ft

# List fatal job alerts
$fatalJobAlerts = Get-PeerGFSFileJobAlerts -Severities FATAL
$fatalJobAlerts.alerts | ft

# List fatal PMC alerts
$fatalPmcAlerts = Get-PeerGFSPmcAlerts -Severities FATAL
$fatalPmcAlerts.alerts | ft

# List scheduled task history
$scheduledTasks = Get-PeerGFSScheduledTasks
$scheduledTasks.scheduledTasks | ft

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.