Guest User

Studio Powershell Toolkit - Sample Script Error

a guest
Jun 11th, 2018
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.50 KB | None | 0 0
  1. feedback: Array
  2. (
  3. [0] => This script demonstrates how the PowerShell Toolkit can be used to automate small workflows
  4. [1] => Start with loading PowerShell Toolkit modules.
  5. [2] => Now let's create a new empty TM.
  6. [3] => A TM created at: c:\Projects\PowerShellToolKit\PowerShellTest\SampleTM\new_en_de.sdltm
  7. [4] => Now let's create a new project which will use the newly created TM.
  8. [5] =>
  9. [6] =>
  10. [7] => Directory: C:\Projects\PowerShellToolKit\PowerShellTest\SampleFiles
  11. [8] =>
  12. [9] =>
  13. [10] => Mode LastWriteTime Length Name
  14. [11] => ---- ------------- ------ ----
  15. [12] => -a--- 12/06/2018 12:13 p.m. 38 sampleTestFile.txt
  16. [13] => New-Object : Exception calling ".ctor" with "2" argument(s): "License check
  17. [14] => failed, with exception: System.UnauthorizedAccessException: Access to the path
  18. [15] => '\Microsoft Corporation\Microsoft� Windows� Operating System\6.3.9600.17396'
  19. [16] => is denied.
  20. [17] => at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
  21. [18] => at System.IO.Directory.InternalCreateDirectory(String fullPath, String
  22. [19] => path, Object dirSecurityObj, Boolean checkHost)
  23. [20] => at System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean
  24. [21] => checkHost)
  25. [22] => at System.IO.Directory.CreateDirectory(String path)
  26. [23] => at System.Windows.Forms.Application.GetDataPath(String basePath)
  27. [24] => at System.Windows.Forms.Application.get_UserAppDataPath()
  28. [25] => at Sdl.Core.PluginFramework.PluginManager.CreateDefaultPluginCache()
  29. [26] => at Sdl.Core.PluginFramework.PluginManager.get_DefaultPluginRegistry()
  30. [27] => at Sdl.Common.Licensing.Provider.Core.LicensingProviderManager.get_Licensing
  31. [28] => ProviderFactories()
  32. [29] => at Sdl.Common.Licensing.Provider.Core.LicensingProviderManager.CreateProvide
  33. [30] => r(ILicensingProviderConfiguration config, String preferredProviderId)
  34. [31] => at Sdl.Common.Licensing.Manager.ApplicationLicenseManager.GetCurrentLicensin
  35. [32] => gProvider()
  36. [33] => at Sdl.Common.Licensing.Manager.ApplicationLicenseManager.GetProduct()
  37. [34] => at Sdl.Common.Licensing.Manager.ApplicationLicenseManager.GetLicenseWithoutC
  38. [35] => onsumingSeatsOrUsages()
  39. [36] => at Sdl.ProjectAutomation.FileBased.FileBasedProject.CheckLicense()"
  40. [37] => At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ProjectHelper\ProjectHelp
  41. [38] => er.psm1:109 char:23
  42. [39] => + $fileBasedProject = New-Object
  43. [40] => Sdl.ProjectAutomation.FileBased.FileBasedProjec ...
  44. [41] => + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  45. [42] => ~~~~~~~~~
  46. [43] => + CategoryInfo : InvalidOperation: (:) [New-Object], MethodInvoca
  47. [44] => tionException
  48. [45] => + FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.Power
  49. [46] => Shell.Commands.NewObjectCommand
  50. [47] =>
  51. [48] => You cannot call a method on a null-valued expression.
  52. [49] => At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ProjectHelper\ProjectHelp
  53. [50] => er.psm1:113 char:2
  54. [51] => + $projectFiles = $fileBasedProject.AddFolderWithFiles($sourceFilesFolder,
  55. [52] => $false ...
  56. [53] => +
  57. [54] => ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  58. [55] => + CategoryInfo : InvalidOperation: (:) [], RuntimeException
  59. [56] => + FullyQualifiedErrorId : InvokeMethodOnNull
  60. [57] =>
  61. [58] => New-Object : Exception calling ".ctor" with "1" argument(s): "Unable to find
  62. [59] => the specified file."
  63. [60] => At
  64. [61] => C:\Windows\system32\WindowsPowerShell\v1.0\Modules\TMHelper\TMHelper.psm1:41
  65. [62] => char:2
  66. [63] => + New-Object
  67. [64] => Sdl.LanguagePlatform.TranslationMemoryApi.FileBasedTranslationMemory ...
  68. [65] => + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  69. [66] => ~~~~~~
  70. [67] => + CategoryInfo : InvalidOperation: (:) [New-Object], MethodInvoca
  71. [68] => tionException
  72. [69] => + FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.Power
  73. [70] => Shell.Commands.NewObjectCommand
  74. [71] =>
  75. [72] => You cannot call a method on a null-valued expression.
  76. [73] => At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ProjectHelper\ProjectHelp
  77. [74] => er.psm1:119 char:3
  78. [75] => + [Sdl.ProjectAutomation.Core.TranslationProviderConfiguration]
  79. [76] => $tmConfig = $fil ...
  80. [77] => + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  81. [78] => ~~~~~~~~~
  82. [79] => + CategoryInfo : InvalidOperation: (:) [], RuntimeException
  83. [80] => + FullyQualifiedErrorId : InvokeMethodOnNull
  84. [81] =>
  85. [82] => You cannot call a method on a null-valued expression.
  86. [83] => At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ProjectHelper\ProjectHelp
  87. [84] => er.psm1:121 char:3
  88. [85] => + $tmConfig.Entries.Add($entry);
  89. [86] => + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  90. [87] => + CategoryInfo : InvalidOperation: (:) [], RuntimeException
  91. [88] => + FullyQualifiedErrorId : InvokeMethodOnNull
  92. [89] =>
  93. [90] => The property 'OverrideParent' cannot be found on this object. Verify that the
  94. [91] => property exists and can be set.
  95. [92] => At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ProjectHelper\ProjectHelp
  96. [93] => er.psm1:122 char:3
  97. [94] => + $tmConfig.OverrideParent = $true;
  98. [95] => + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  99. [96] => + CategoryInfo : InvalidOperation: (:) [], RuntimeException
  100. [97] => + FullyQualifiedErrorId : PropertyNotFound
  101. [98] =>
  102. [99] => You cannot call a method on a null-valued expression.
  103. [100] => At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ProjectHelper\ProjectHelp
  104. [101] => er.psm1:123 char:3
  105. [102] => +
  106. [103] => $fileBasedProject.UpdateTranslationProviderConfiguration($tmTargetLanguage, $t
  107. [104] => ...
  108. [105] => + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  109. [106] => ~~~~~~~~~
  110. [107] => + CategoryInfo : InvalidOperation: (:) [], RuntimeException
  111. [108] => + FullyQualifiedErrorId : InvokeMethodOnNull
  112. [109] =>
  113. [110] => You cannot call a method on a null-valued expression.
  114. [111] => At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ProjectHelper\ProjectHelp
  115. [112] => er.psm1:127 char:2
  116. [113] => + [Sdl.ProjectAutomation.Core.ProjectFile[]] $projectFiles =
  117. [114] => $fileBasedProject.Ge ...
  118. [115] => + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  119. [116] => ~~~~~~
  120. [117] => + CategoryInfo : InvalidOperation: (:) [], RuntimeException
  121. [118] => + FullyQualifiedErrorId : InvokeMethodOnNull
  122. [119] =>
  123. [120] => You cannot call a method on a null-valued expression.
  124. [121] => At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ProjectHelper\ProjectHelp
  125. [122] => er.psm1:131 char:2
  126. [123] => + Validate-Task
  127. [124] => $fileBasedProject.RunAutomaticTask($sourceFilesGuids,[Sdl.Project ...
  128. [125] => + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  129. [126] => ~~~~~~
  130. [127] => + CategoryInfo : InvalidOperation: (:) [], RuntimeException
  131. [128] => + FullyQualifiedErrorId : InvokeMethodOnNull
  132. [129] =>
  133. [130] => You cannot call a method on a null-valued expression.
  134. [131] => At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ProjectHelper\ProjectHelp
  135. [132] => er.psm1:132 char:2
  136. [133] => + Validate-Task
  137. [134] => $fileBasedProject.RunAutomaticTask($sourceFilesGuids,[Sdl.Project ...
  138. [135] => + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  139. [136] => ~~~~~~
  140. [137] => + CategoryInfo : InvalidOperation: (:) [], RuntimeException
  141. [138] => + FullyQualifiedErrorId : InvokeMethodOnNull
  142. [139] =>
  143. [140] => You cannot call a method on a null-valued expression.
  144. [141] => At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ProjectHelper\ProjectHelp
  145. [142] => er.psm1:133 char:2
  146. [143] => + Validate-Task
  147. [144] => $fileBasedProject.RunAutomaticTask($sourceFilesGuids,[Sdl.Project ...
  148. [145] => + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  149. [146] => ~~~~~~
  150. [147] => + CategoryInfo : InvalidOperation: (:) [], RuntimeException
  151. [148] => + FullyQualifiedErrorId : InvokeMethodOnNull
  152. [149] =>
  153. [150] => You cannot call a method on a null-valued expression.
  154. [151] => At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ProjectHelper\ProjectHelp
  155. [152] => er.psm1:139 char:3
  156. [153] => + $targetFiles =
  157. [154] => $fileBasedProject.GetTargetLanguageFiles($targetLanguage);
  158. [155] => +
  159. [156] => ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  160. [157] => + CategoryInfo : InvalidOperation: (:) [], RuntimeException
  161. [158] => + FullyQualifiedErrorId : InvokeMethodOnNull
  162. [159] =>
  163. [160] => You cannot call a method on a null-valued expression.
  164. [161] => At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ProjectHelper\ProjectHelp
  165. [162] => er.psm1:142 char:3
  166. [163] => + Validate-Task
  167. [164] => $fileBasedProject.RunAutomaticTask($targetFilesGuids,[Sdl.Projec ...
  168. [165] => + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  169. [166] => ~~~~~~~~~
  170. [167] => + CategoryInfo : InvalidOperation: (:) [], RuntimeException
  171. [168] => + FullyQualifiedErrorId : InvokeMethodOnNull
  172. [169] =>
  173. [170] => You cannot call a method on a null-valued expression.
  174. [171] => At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ProjectHelper\ProjectHelp
  175. [172] => er.psm1:143 char:3
  176. [173] => + Validate-Task
  177. [174] => $fileBasedProject.RunAutomaticTask($targetFilesGuids,[Sdl.Projec ...
  178. [175] => + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  179. [176] => ~~~~~~~~~
  180. [177] => + CategoryInfo : InvalidOperation: (:) [], RuntimeException
  181. [178] => + FullyQualifiedErrorId : InvokeMethodOnNull
  182. [179] =>
  183. [180] => You cannot call a method on a null-valued expression.
  184. [181] => At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ProjectHelper\ProjectHelp
  185. [182] => er.psm1:147 char:2
  186. [183] => + $fileBasedProject.Save();
  187. [184] => + ~~~~~~~~~~~~~~~~~~~~~~~~
  188. [185] => + CategoryInfo : InvalidOperation: (:) [], RuntimeException
  189. [186] => + FullyQualifiedErrorId : InvokeMethodOnNull
  190. [187] =>
  191. [188] => A new project creation completed.
  192. [189] => Now open project and get analyze statistics.
  193. [190] => You cannot call a method on a null-valued expression.
  194. [191] => At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ProjectHelper\ProjectHelp
  195. [192] => er.psm1:159 char:2
  196. [193] => + $fileBasedProject = New-Object
  197. [194] => Sdl.ProjectAutomation.FileBased.FileBasedProject ...
  198. [195] => + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  199. [196] => ~~~~~~
  200. [197] => + CategoryInfo : InvalidOperation: (:) [], RuntimeException
  201. [198] => + FullyQualifiedErrorId : InvokeMethodOnNull
  202. [199] =>
  203. [200] => You cannot call a method on a null-valued expression.
  204. [201] => At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ProjectHelper\ProjectHelp
  205. [202] => er.psm1:169 char:2
  206. [203] => + $projectStatistics = $project.GetProjectStatistics();
  207. [204] => + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  208. [205] => + CategoryInfo : InvalidOperation: (:) [], RuntimeException
  209. [206] => + FullyQualifiedErrorId : InvokeMethodOnNull
  210. [207] =>
  211. [208] => Now for each target language create translation package.
  212. [209] => You cannot call a method on a null-valued expression.
  213. [210] => At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ProjectHelper\ProjectHelp
  214. [211] => er.psm1:19 char:23
  215. [212] => + foreach($taskfile in $project.GetTargetLanguageFiles($language))
  216. [213] => + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  217. [214] => + CategoryInfo : InvalidOperation: (:) [], RuntimeException
  218. [215] => + FullyQualifiedErrorId : InvokeMethodOnNull
  219. [216] =>
  220. [217] => You cannot call a method on a null-valued expression.
  221. [218] => At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PackageHelper\PackageHelp
  222. [219] => er.psm1:22 char:2
  223. [220] => + [Sdl.ProjectAutomation.Core.ManualTask] $task =
  224. [221] => $projectToProcess.CreateManualT ...
  225. [222] => + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  226. [223] => ~~~~~~
  227. [224] => + CategoryInfo : InvalidOperation: (:) [], RuntimeException
  228. [225] => + FullyQualifiedErrorId : InvokeMethodOnNull
  229. [226] =>
  230. [227] => You cannot call a method on a null-valued expression.
  231. [228] => At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PackageHelper\PackageHelp
  232. [229] => er.psm1:24 char:2
  233. [230] => + [Sdl.ProjectAutomation.Core.ProjectPackageCreation] $package =
  234. [231] => $projectToProces ...
  235. [232] => + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  236. [233] => ~~~~~~
  237. [234] => + CategoryInfo : InvalidOperation: (:) [], RuntimeException
  238. [235] => + FullyQualifiedErrorId : InvokeMethodOnNull
  239. [236] =>
  240. [237] => You cannot call a method on a null-valued expression.
  241. [238] => At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PackageHelper\PackageHelp
  242. [239] => er.psm1:26 char:2
  243. [240] => + $projectToProcess.SavePackageAs($package.PackageId, $packagePath);
  244. [241] => + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  245. [242] => + CategoryInfo : InvalidOperation: (:) [], RuntimeException
  246. [243] => + FullyQualifiedErrorId : InvokeMethodOnNull
  247. [244] =>
  248. [245] => Completed.
  249. [246] =>
  250. [247] =>
  251. )
Advertisement
Add Comment
Please, Sign In to add comment