Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get-InstallCommand - spaces in filename #11

Closed
Boss-man opened this issue Nov 13, 2023 · 5 comments
Closed

Get-InstallCommand - spaces in filename #11

Boss-man opened this issue Nov 13, 2023 · 5 comments

Comments

@Boss-man
Copy link

I have a $SetupFile variable as this: msiexec /i "Print Settings 1.0.1.msi" /q
The resulting $command is "1.0.1.msi", which is not right.

Don't know if spaces in the filename can be handled somehow.

@dancing-groot
Copy link

It depends on how you defined the variable, did you surround it with single quotes? e.g.
$SetupFile = 'msiexec /i "Print Settings 1.0.1.msi" /q'

@Boss-man
Copy link
Author

It depends on how you defined the variable, did you surround it with single quotes? e.g. $SetupFile = 'msiexec /i "Print Settings 1.0.1.msi" /q'

I don't define it, it's in the source code in the Get-InstallCommand function. And it takes the value from the SCCM application install command.

@byteben
Copy link
Owner

byteben commented Nov 13, 2023 via email

@obuolinis
Copy link

Ben, you're splitting the $SetupFile line first by $InstallTech (.msi in this case) and then by a " " (space), that's why you end up with just "1.0.1.msi".
To be able to handle filenames with spaces your Get-InstallCommand function would require a different splitting logic. And I'm afraid it could not be very straightforward to come up with a one-fits-all version - I mean how do you tell whether a space is part of a filename or not?

byteben added a commit that referenced this issue Dec 16, 2023
@byteben
Copy link
Owner

byteben commented Dec 16, 2023

Semi-confident this is now fixed in 2.0.19 branch @Boss-man
Replace Get-InstallCommand.ps1 in your module directory with the one from branch https://github.com/byteben/Win32App-Migration-Tool/tree/version-2.0.19 and let me know. Thank you.

@byteben byteben closed this as completed Dec 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants