SQLServerPSModule icon indicating copy to clipboard operation
SQLServerPSModule copied to clipboard

Write-SQLTableData has no ProgressAction Parameter with Powershell 5.1 what is not documented

Open DennisBergemann opened this issue 11 months ago • 3 comments

Hello,

like mentioned in the headline, the Write-SQLTableData command has in Powershell 5.1 no progressaction parameter. This is no issue when we know it, but in documentaion for this module is no hint about it.

Thanks a lot

DennisBergemann avatar Dec 12 '24 12:12 DennisBergemann

Hello,

i found out that in automation account the module has no -ProgressAction for powershell 7 as well.

Is this expected behavior because of automation account?

DennisBergemann avatar Feb 07 '25 10:02 DennisBergemann

Hi @DennisBergemann - that's weird.

That parameter is usually added automatically by PowerShell and there's nothing I usually do to.

I'm also a bit confused. When I run

Get-Help Write-SqlTableData

I see it:

PS C:\Users\matteot> Get-Help Write-SqlTableData

NAME
    Write-SqlTableData

SYNOPSIS
    Writes data to a table of a SQL database.


SYNTAX
    Write-SqlTableData [[-ServerInstance] <String[]>] [-AccessToken <PSObject>] [-ConnectionTimeout <Int32>]
    [-ConnectToDatabase] [-Credential <PSCredential>] [-DatabaseName <String>] [-Encrypt {Mandatory | Optional |
    Strict}] [-Force] [-HostNameInCertificate <String>] [-IgnoreProviderContext] -InputData <PSObject> [-Passthru]
    [-ProgressAction <ActionPreference>] [-SchemaName <String>] [-SuppressProviderContextWarning] [-TableName
    <String>] [-Timeout <Int32>] [-TrustServerCertificate] [<CommonParameters>]
...

What am I missing? Could you provide more info? Thanks!!!

Matteo-T avatar Mar 03 '25 10:03 Matteo-T

Hi Matteo-T,

you can easy test it. Use the cmdlet with powershell 5.1 or within automation account, then you will an error that progress action is unknown.

King regards

DennisBergemann avatar Mar 05 '25 21:03 DennisBergemann

Oh I see. You are telling me that PlatyPS generated the documentation using PS7 and, in theory, I should generate 2 sets of docs files: one for PS5 and one for PS7.

I think it's a bit of an overkill.

-ProgressAction is a PS7.4+ thing, so I think users will be smart enough to avoid it.

Matteo-T avatar Jun 14 '25 16:06 Matteo-T

@Matteo-T you interpreted wrong. The documentation was on original Microsoft siite wrong. I need no other documentation and it’s easy to see if I am on 7 or 5. At the End it would be good to know how to avoid the Progress in Console, because it crashes interactive consoles in powershell 5. It floods buffer /memory

DennisBergemann avatar Jun 14 '25 18:06 DennisBergemann