Home Forums Programming Powershell How to exclude replication stored procedures from a script? RE: How to exclude replication stored procedures from a script?

  • opc.three (6/25/2012)


    opc.three (6/25/2012)


    Try it with -Name, like this:

    Get-ChildItem -Name -Exclude dbo.sp_MS*

    😛 and then I remembered the initial intent...

    Try this one:

    Get-ChildItem | Where-Object {$_.name -NotLike "sp_MS"} | %{$_.Script($so) + " GO " | Out-File "Z:\MyDB\08_SPs $timestamp.sql" -Append}

    Doesn't work either. I am still getting the replication SPs in the list. Should I put some sort of wildcard character into the like statement?