JamesDBartlett3 / PowerBits

A collection of useful, time-saving tools for working with Microsoft Power BI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PowerShellScript/Copy-PowerBIReportContentToBlankPBIXFile.ps1

olivierlenard opened this issue · comments

Hi James,

Your script was a real help for my daily work with colleagues creating reports online before realising the need the desktop version for advanced features.
Lately I have the following error running the script :

On Characters:184 : 25
+   $OutFile = !!$OutFile ? $OutFile : "$($sourceReportName)_Clone.pbix ...
+                         ~
Unexpected Token « ? » in the expression or instruction.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : UnexpectedToken

Did you already had it, any idea ?

Thanks !

Hi all,

Any clue ?

Best !

Olivier LN

Hi, @olivierlenard, that looks like an error you might encounter if you're using a version of PowerShell that does not recognize the ternary operator. Are you using the latest version of PowerShell 7?