Az.Computer.psm1

function Get-AzComputerInfo {
    # Define the URL of the API that provides random puppy photos
    $apiUrl = "https://dog.ceo/api/breeds/image/random"

    # Make a web request to the API
    $response = Invoke-RestMethod -Uri $apiUrl -Method Get

    # Extract the URL of the puppy photo from the response
    $puppyPhotoUrl = $response.message

    # Define the local path where the photo will be saved
    $localPath = "C:\path\to\save\puppy.jpg"

    # Download the puppy photo and save it to the local path
    Invoke-WebRequest -Uri $puppyPhotoUrl -OutFile $localPath

    # Display the photo using the default image viewer
    Start-Process $localPath

    # Output a message indicating the photo has been saved and displayed
    Write-Host "Puppy photo saved to $localPath and displayed."
}

# Export the function if you are adding it to a module
Export-ModuleMember -Function Get-AzComputerInfo