PowerShell脚本 - 使用Ghostscript将PDF转换为TIF

时间:2015-09-16 02:48:31

标签: powershell ghostscript

我在这里缺少什么?

我收到此错误:

from apps.flooring.models import Tile

class Migration(DataMigration):
    def forwards(self, orm):
        tiles = orm.Tile.objects.filter(flooring__name="white")
        for tile in tiles:
            # Convert orm.Tile into Tile model to access serialization mixin
            t = Tile(**{k:v for (k,v) in t.__dict__.iteritems() if not k.startswith('_')})

            # update the orm.Tile model with new cache
            tile.cache = t.to_json()
            tile.save(update_fields=['cache'])

运行此脚本时:

ERROR converting File
E:\DocuTA\TIFs\06fef98e-e1c5-405e-93ea-c684ee7a856d.tif 
nvoke-Expression : You must provide a value expression on the
right-hand side of the '-' operator.  At E:\DocuTA\ConvPDFtoTIF.ps1:31
char:26 + $ret = invoke-expression <<<< -command $cmdline +
CategoryInfo : ParserError: (:) [Invoke-Expression], ParseException +
FullyQualifiedErrorId :
ExpectedValueExpression,Microsoft.PowerShell.Commands.InvokeExpressionCommand

1 个答案:

答案 0 :(得分:0)

看起来PowerShell不喜欢使用 - 对于交换机,请尝试使用#而不是