Open MiamiFinsFan13 opened 2 years ago
I have the below code to upload a Win32 file
`import-module C:\Scripts\powershell-intune-samples-master\LOB_Application\Win32_Application_Add.ps1 -Force $SourceFile = "C:\Scripts\Intune Packaging\Packages\Printers\PrinterInstall.intunewin" $RegistryRule = New-DetectionRule -Registry -RegistryKeyPath "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers\BL-NS-GRN-GRN-FL1-P01" -RegistryDetectionType exists -check32BitRegOn64System False $ReturnCodes = Get-DefaultReturnCodes
$DetectionRule = @($RegistryRule)
Upload-Win32Lob -DisplayName -SourceFile "$SourceFile" -publisher "BrokerLink" -description "Printer 1 for Grand Falls" -detectionRules $DetectionRule -returnCodes $ReturnCodes -installCmdLine "PowerShell.exe -ExecutionPolicy Bypass -Command ""&" '.\PrinterInstall.ps1' -PrinterDriverName 'DriverName' -PrinterName ‘PrinterName' -PrinterPort 'xxx.xxx.xxx.xxx'""`
and it keeps outputting this error
PS C:\windows\system32> import-module C:\Scripts\powershell-intune-samples-master\LOB_Application\Win32_Application_Add.ps1 -Force $SourceFile = "C:\Scripts\Intune Packaging\Packages\Printers\PrinterInstall.intunewin" $RegistryRule = New-DetectionRule -Registry -RegistryKeyPath "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers\BL-NS-GRN-GRN-FL1-P01" -RegistryDetectionType exists -check32BitRegOn64System False $ReturnCodes = Get-DefaultReturnCodes
Upload-Win32Lob -DisplayName -SourceFile "$SourceFile" -publisher "BrokerLink" -description "Printer 1 for Grand Falls" -detectionRules $DetectionRule -returnCodes $ReturnCodes -installCmdLine "PowerShell.exe -ExecutionPolicy Bypass -Command ""&" '.\PrinterInstall.ps1' -PrinterDriverName 'Xerox Global PCL6' -PrinterName ‘BL-NS-GRN-GRN-FL1-P01' -PrinterPort '172.16.170.132'""
Source File 'C:\packages\package.intunewin' doesn't exist... ScriptHalted
I can't for the life of me figure out why it is changing the location of the Source File. Am I missing something here?
line 1167 of the script has a hard code path and filename. Comment that out and it should work.
I have the below code to upload a Win32 file
`import-module C:\Scripts\powershell-intune-samples-master\LOB_Application\Win32_Application_Add.ps1 -Force $SourceFile = "C:\Scripts\Intune Packaging\Packages\Printers\PrinterInstall.intunewin" $RegistryRule = New-DetectionRule -Registry -RegistryKeyPath "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers\BL-NS-GRN-GRN-FL1-P01" -RegistryDetectionType exists -check32BitRegOn64System False $ReturnCodes = Get-DefaultReturnCodes
$DetectionRule = @($RegistryRule)
Upload-Win32Lob -DisplayName -SourceFile "$SourceFile" -publisher "BrokerLink" -description "Printer 1 for Grand Falls" -detectionRules $DetectionRule -returnCodes $ReturnCodes -installCmdLine "PowerShell.exe -ExecutionPolicy Bypass -Command ""&" '.\PrinterInstall.ps1' -PrinterDriverName 'DriverName' -PrinterName ‘PrinterName' -PrinterPort 'xxx.xxx.xxx.xxx'""`
and it keeps outputting this error
PS C:\windows\system32> import-module C:\Scripts\powershell-intune-samples-master\LOB_Application\Win32_Application_Add.ps1 -Force $SourceFile = "C:\Scripts\Intune Packaging\Packages\Printers\PrinterInstall.intunewin" $RegistryRule = New-DetectionRule -Registry -RegistryKeyPath "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers\BL-NS-GRN-GRN-FL1-P01" -RegistryDetectionType exists -check32BitRegOn64System False $ReturnCodes = Get-DefaultReturnCodes
$DetectionRule = @($RegistryRule)
Upload-Win32Lob -DisplayName -SourceFile "$SourceFile" -publisher "BrokerLink" -description "Printer 1 for Grand Falls" -detectionRules $DetectionRule -returnCodes $ReturnCodes -installCmdLine "PowerShell.exe -ExecutionPolicy Bypass -Command ""&" '.\PrinterInstall.ps1' -PrinterDriverName 'Xerox Global PCL6' -PrinterName ‘BL-NS-GRN-GRN-FL1-P01' -PrinterPort '172.16.170.132'""
Source File 'C:\packages\package.intunewin' doesn't exist... ScriptHalted
I can't for the life of me figure out why it is changing the location of the Source File. Am I missing something here?