tag:blogger.com,1999:blog-4345146843103561516.post2523349564680000375..comments2024-03-16T19:30:48.656+01:00Comments on Syst & Deploy : PS1 To Exe Generator - New versionDamien Van Robaeyshttp://www.blogger.com/profile/01727425872869711422noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-4345146843103561516.post-27988652442797006282020-08-05T16:10:51.019+02:002020-08-05T16:10:51.019+02:00Hi!!!
I was having issues running the PS1ToEXE_Ge...Hi!!!<br /><br />I was having issues running the PS1ToEXE_Generator.ps1 because the DLL's wasn't been loaded:<br /><br />Exception calling "LoadFrom" with "1" argument(s): "Could not load file or assembly 'file:///R:\MahApps.Metro.dll' or one of its dependencies. The system cannot find<br />the file specified."<br />At C:\Users\F09348\Desktop\PS2EXE\New_Version\Sources\Sources\PS1ToEXE_Generator.ps1:12 char:1<br />+ [System.Reflection.Assembly]::LoadFrom('MahApps.Metro.dll') ...<br />+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br /> + CategoryInfo : NotSpecified: (:) [], MethodInvocationException<br /> + FullyQualifiedErrorId : FileNotFoundException<br /><br />Exception calling "LoadFrom" with "1" argument(s): "Could not load file or assembly 'file:///R:\MahApps.Metro.IconPacks.dll' or one of its dependencies. The system<br />cannot find the file specified."<br />At C:\Users\XXXXXXX\Desktop\PS2EXE\New_Version\Sources\Sources\PS1ToEXE_Generator.ps1:13 char:1<br />+ [System.Reflection.Assembly]::LoadFrom('MahApps.Metro.IconPacks.dll') ...<br />+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br /> + CategoryInfo : NotSpecified: (:) [], MethodInvocationException<br /> + FullyQualifiedErrorId : FileNotFoundException<br /><br />Exception calling "Load" with "1" argument(s): "Could not find file 'R:\PS1ToEXE_Generator.xaml'."<br />At C:\Users\XXXXXXX\Desktop\PS2EXE\New_Version\Sources\Sources\PS1ToEXE_Generator.ps1:18 char:5<br />+ $XamlLoader.Load($filename)<br />+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~<br /> + CategoryInfo : NotSpecified: (:) [], MethodInvocationException<br /> + FullyQualifiedErrorId : DotNetMethodException<br /><br /><br /><br /><br /><br />I suggest you to update use the variable $PSScriptRoot to create a full path<br /><br />Look:<br /><br /><br />[System.Reflection.Assembly]::LoadFrom($PSScriptRoot + '\MahApps.Metro.dll') | out-null # <<<< Here<br />[System.Reflection.Assembly]::LoadFrom($PSScriptRoot + '\MahApps.Metro.IconPacks.dll') | out-null # <<<< Here<br /><br />and<br /><br /><br />$XamlMainWindow=LoadXml($PSScriptRoot + "\PS1ToEXE_Generator.xaml") # <<<< Here<br /><br /><br /><br /><br /><br /><br /><br /><br />Diego Marinshttps://www.blogger.com/profile/12792915295248625380noreply@blogger.com