Private/Get-specEposAndStoreName.ps1

Function Get-specEposAndStorename {
    <#
    .SYNOPSIS
        Retrieves EPOS and StoreName information for a specified device.
 
    .DESCRIPTION
        The Get-specEposAndStorename function queries an Azure table for EPOS and StoreName information based on the provided parameters.
        It takes the computer name, Azure table name, storage account, and SAS token as input and returns a custom object with StoreName and EPOS properties.
 
    .PARAMETER ComputerName
        Specifies the name of the computer. Defaults to the environment variable COMPUTERNAME.
 
    .PARAMETER TableName
        Specifies the name of the Azure table.
 
    .PARAMETER StorageAccount
        Specifies the name of the Azure Storage Account.
 
    .PARAMETER SASToken
        Specifies the Shared Access Signature (SAS) token for accessing the Azure Storage Account.
 
    .EXAMPLE
        Get-specEposAndStorename -ComputerName "ExampleComputer" -TableName "ExampleTable" -StorageAccount "ExampleAccount" -SASToken "ExampleToken"
        Retrieves EPOS and StoreName information for the specified computer.
 
    .NOTES
        Author : owen.heaume
        Version : 1.0
    #>



    [cmdletBinding()]

    param (
        [Alias("CN", "Device", "ManagementID")]
        [parameter (mandatory = $false)]
        [string]$ComputerName = $env:COMPUTERNAME,

        [parameter (mandatory = $true)]
        [string]$TableName,

        [parameter (mandatory = $true)]
        [string]$StorageAccount,

        [parameter (mandatory = $true)]
        [string]$SASToken
    )

    $params = @{
        value          = $ComputerName
        Key            = 'RowKey'
        tableName      = $TableName
        StorageAccount = $StorageAccount
        SASToken       = $SASToken
    }

    $tableResult = Get-SpecAzTableRowUsingSAS @params
    

    [pscustomobject]@{        
        StoreName  = $tableResult.StoreName
        Epos = $tableResult.EPOS
    }
}