JamesDBartlett3 / PowerBits

A collection of useful, time-saving tools for working with Microsoft Power BI
Open Software License 3.0
48 stars 13 forks source link

PowerShellScript/Copy-PowerBIReportContentToBlankPBIXFile.ps1 #11

Open olivierlenard opened 8 months ago

olivierlenard commented 8 months ago

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 !

olivierlenard commented 7 months ago

Hi all,

Any clue ?

Best !

Olivier LN

JamesDBartlett3 commented 7 months ago

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?