Meekers.General/Meekers.General.psm1

# Documentation --- Need to Document: Clear-DowloadsFolder
function Clear-DowloadsFolder {
    <#
    .DESCRIPTION
    Clears all files out of downloads
    #>

    
    param (
        [Parameter(Mandatory = $false)]    
        [string]$Path = "$env:USERPROFILE\Downloads"
    )
    
    Get-ChildItem -Path $Path -Recurse | Remove-Item -Force
}

# Documentation --- Need to Document Get-MyIP
function Get-MyIP {
    <#
    .SYNOPSIS
        A short one-line action-based description, e.g. 'Tests if a function is valid'
    .DESCRIPTION
        A longer description of the function, its purpose, common use cases, etc.
    .NOTES
        Information or caveats about the function e.g. 'This function is not supported in Linux'
    .LINK
        Specify a URI to a help page, this will show when Get-Help -Online is used.
    .EXAMPLE
        Test-MyTestFunction -Verbose
        Explanation of the function or its result. You can include multiple examples with additional .EXAMPLE lines
    #>

    
    $ip = Invoke-RestMethod -Uri "https://api.ipify.org?format=json"
    $ip.ip
}

# Documentation --- Need to Document: Get-LimeLargeFile
function Get-LimeLargeFile {
    <#
    .SYNOPSIS
        A short one-line action-based description, e.g. 'Tests if a function is valid'
    .DESCRIPTION
        A longer description of the function, its purpose, common use cases, etc.
    .NOTES
        Information or caveats about the function e.g. 'This function is not supported in Linux'
    .LINK
        Specify a URI to a help page, this will show when Get-Help -Online is used.
    .EXAMPLE
        Test-MyTestFunction -Verbose
        Explanation of the function or its result. You can include multiple examples with additional .EXAMPLE lines
    #>

    
    param (
        [Parameter(Mandatory = $true)]
        [string]$SMBPath
    )
    
    $files = Get-ChildItem -Path $SMBPath -Recurse | Where-Object { $_.Length -gt 12GB }

    $BigFiles = $files | ForEach-Object {
        $sizeInGB = $_.Length / 1GB
        [PSCustomObject]@{
            Name = $_.Name
            Size = "{0:N2} GB" -f $sizeInGB
            Path = $_.FullName
        }
    }
    $BigFiles | Format-Table -AutoSize
}

# Documentation --- Need to Document: Get-FileSize
function Get-FileSize {
    <#
    .SYNOPSIS
        A short one-line action-based description, e.g. 'Tests if a function is valid'
    .DESCRIPTION
        A longer description of the function, its purpose, common use cases, etc.
    .NOTES
        Information or caveats about the function e.g. 'This function is not supported in Linux'
    .LINK
        Specify a URI to a help page, this will show when Get-Help -Online is used.
    .EXAMPLE
        Test-MyTestFunction -Verbose
        Explanation of the function or its result. You can include multiple examples with additional .EXAMPLE lines
    #>

    
    param (
        [Parameter(Mandatory = $true)]
        [string]$FilePath
    )
    
    if (Test-Path -Path $FilePath) {
        $sizeInBytes = (Get-Item -Path $FilePath).Length
        $sizeInMB = $sizeInBytes / 1GB
        [PSCustomObject]@{
            FilePath = $FilePath
            SizeInBytes = $sizeInBytes
            SizeInMB = "{0:N2} GB" -f $sizeInMB
        }
    } else {
        Write-Error "File not found: $FilePath"
    }
}