PowerShell invoke-sqlcmd Get-ChildItem : Cannot call method. The provider does not support the use of filters

前端 未结 3 1071
后悔当初
后悔当初 2021-01-24 02:37

I have a strange error occurring when using the invoke-sqlcmd to insert rows into a table. The entire script works perfectly if executed one time, but if I run it a second time,

3条回答
  •  既然无缘
    2021-01-24 02:41

    This may or may not help you. I had the same error when trying to run my script in a SQL Agent job. It would work fine for my account and the service account the agent was running under but refused to work as a job until I prefixed the UNC file path it was reading with

    Microsoft.PowerShell.Core\FileSystem::

    I don't recommend file shares in automation solutions... but had no choice. Hope it helps.

提交回复
热议问题