MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/PowerShell/comments/z6qz8q/psmsi_create_msis_with_powershell/iyjsjft/?context=3
r/PowerShell • u/[deleted] • Nov 28 '22
11 comments sorted by
View all comments
17
Nice, easier than messing around with XML that you normally have to do a bit of with WiX toolset.
Can -Content contain any PS code? Ie so you can do:
-Content
-content { Get-Childitem $path | New-InstallerFile }
6 u/har0ldau Nov 28 '22 Looking at the code, it does seem possible. 1 u/skatterbrainz Nov 29 '22 If you include -File (PS 7.x) or on PS 5.1 use Where {$_.Attributes -ne 'Directory'} it works fine. But on PS 5.1, get -childitem still returns sub-directories, and that will cause an error with New-InstallerFile 2 u/Forsaken_Class3432 Dec 01 '22 -File works in PS5.1 & PS7+ 1 u/skatterbrainz Dec 04 '22 You are correct. I was working with a bunch of VM's that day and some were on PS 2.0 (no kidding). Thanks for the correction!
6
Looking at the code, it does seem possible.
1 u/skatterbrainz Nov 29 '22 If you include -File (PS 7.x) or on PS 5.1 use Where {$_.Attributes -ne 'Directory'} it works fine. But on PS 5.1, get -childitem still returns sub-directories, and that will cause an error with New-InstallerFile 2 u/Forsaken_Class3432 Dec 01 '22 -File works in PS5.1 & PS7+ 1 u/skatterbrainz Dec 04 '22 You are correct. I was working with a bunch of VM's that day and some were on PS 2.0 (no kidding). Thanks for the correction!
1
If you include -File (PS 7.x) or on PS 5.1 use Where {$_.Attributes -ne 'Directory'} it works fine. But on PS 5.1, get -childitem still returns sub-directories, and that will cause an error with New-InstallerFile
2 u/Forsaken_Class3432 Dec 01 '22 -File works in PS5.1 & PS7+ 1 u/skatterbrainz Dec 04 '22 You are correct. I was working with a bunch of VM's that day and some were on PS 2.0 (no kidding). Thanks for the correction!
2
-File works in PS5.1 & PS7+
1 u/skatterbrainz Dec 04 '22 You are correct. I was working with a bunch of VM's that day and some were on PS 2.0 (no kidding). Thanks for the correction!
You are correct. I was working with a bunch of VM's that day and some were on PS 2.0 (no kidding). Thanks for the correction!
17
u/purplemonkeymad Nov 28 '22
Nice, easier than messing around with XML that you normally have to do a bit of with WiX toolset.
Can
-Contentcontain any PS code? Ie so you can do: