• tt-615680 (9/25/2015)


    Thank you for your help! I’ve tried to run the scrip but unfortatly I get the following error message, I have changed the location name where the transactional log file is coming from and the server name, databasename etc but I’m not sure what else I’m missing?

    The term 'Restore-sqlDatabase' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

    At line:1 char:12 + Restore-sqldatabase <<<< -serverinstance [nameofserver] -Database [databasename]`

    + CategoryInfo : ObjectNotFound: (Restore-sql:String) [], CommandNotFoundException

    + FullyQualifiedErrorId : CommandNotFoundException

    PS g:\\transactionallogbackuplocation > -BackupFile $Bakfile.Fullname -Checksum`

    Missing expression after unary operator '-'.

    At line:1 char:2

    + - <<<< BackupFile $Bakfile.Fullname -Checksum`

    + CategoryInfo : ParserError: (-:String) [], ParentContainsErrorRecordException

    + FullyQualifiedErrorId : MissingExpressionAfterOperator

    Thank you!

    the pc/server where you develop this ps1 script, should have SQLPS installed ( comes with the full sql2014 client ).

    The one running the script, should have access to the given location as does the sqlserver service account of the target instance.

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me