Get-DockerStatsSnapshot.ps1


Description

Purpose

Retrieves the Docker container statistics snapshot.

Detailed Description

The Get-DockerStatsSnapshot function retrieves the current statistics snapshot of Docker containers. It checks if any Docker containers are running and displays the statistics if there are any. If no containers are running, a warning message is displayed.

Back to Top

Usage

Example 1

Get-DockerStatsSnapshot

Retrieves the Docker container statistics snapshot.

Back to Top

Notes

Author: Your Name Date: Date created

Back to Top


Script

<#
.SYNOPSIS
Retrieves the Docker container statistics snapshot.

.DESCRIPTION
The Get-DockerStatsSnapshot function retrieves the current statistics snapshot of Docker containers. It checks if any Docker containers are running and displays the statistics if there are any. If no containers are running, a warning message is displayed.

.NOTES
Author: Your Name
Date: Date created

.EXAMPLE
Get-DockerStatsSnapshot
# Retrieves the Docker container statistics snapshot.

#> 
function Get-DockerStatsSnapshot {
	$running = docker images -q
	if ($null -eq $running) {
		Write-Warning -Message "No Docker Containers are running"
	}
	else {
		docker container stats --no-stream
	}
}

Back to Top

Download

Please feel free to copy parts of the script or if you would like to download the entire script, simply click the download button. You can download the complete repository in a zip file by clicking the Download link in the menu bar on the left hand side of the page.


Report Issues

You can report an issue or contribute to this site on GitHub. Simply click the button below and add any relevant notes. I will attempt to respond to all issues as soon as possible.

Issue


Back to Top