Skip to content

Instantly share code, notes, and snippets.

@TheBigBear
TheBigBear / gist:bb99cab5fcf0a7d2fdd4
Created February 14, 2015 13:09
how to overcome this powershell quoting or invalid path issue?
this code stumbles over the $Path being invalid , because some Uninstall entries contain characters that aren't valid in a file path, but are perfectly valid inside the regisry.
it gives me the error:
```
Get-ItemProperty : Cannot retrieve the dynamic parameters for the cmdlet. The specified wildcard character pattern is
not valid: Bomgar Jump Client [help.ict-software.org-5478B883]
At C:\temp\Do-Uninstall.ps1:2 char:92
+ ... l" | foreach { gp $_.PSPath } | ? { '$_' -match "Wget-1.11.4-1_is1" } | select U ...
+ ~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Get-ItemProperty], ParameterBindingException
@TheBigBear
TheBigBear / ReadMe.md
Last active February 8, 2023 10:53
get a file from web URL and figure out it's filename

I am trying to get a powershell script that I can call with one (or two) params.

Ideally I would like to pass only one paramter, the $Url and expect the script to figure out the filename and then download to that filename.

IF it does not figure out a filename, I can optionally pass a second parameter the $FolderPath

# get-FileFromUri.ps1
function get-FileFromUri {
  param(
@TheBigBear
TheBigBear / gist:223069ea1e4394ea962b
Created February 8, 2015 19:34
why does it skip the auto-uninstaller when the auto-uninstaller feature is on?
C:\temp\fakepackage> choco feature
Chocolatey v0.9.9.0
checksumFiles - [Enabled]
autoUninstaller - [Enabled]
allowInsecureConfirmation - [Disabled]
C:\temp\fakepackage> choco install windirstat
Chocolatey v0.9.9.0
Installing the following packages:
windirstat
By installing you accept licenses for the packages.
C:\temp\fakepackage> choco.exe source add -n local -s c:\packages -debug
Chocolatey v0.9.9.0
Chocolatey is running on Windows v 6.2.9200.0
Unpacking helpers\chocolateyInstaller.psm1 to 'C:\ProgramData\chocolatey\helpers\chocolateyInstaller.psm1'
Unpacking helpers\functions\Get-BinRoot.ps1 to 'C:\ProgramData\chocolatey\helpers\functions\Get-BinRoot.ps1'
Unpacking helpers\functions\Get-CheckSumValid.ps1 to 'C:\ProgramData\chocolatey\helpers\functions\Get-CheckSumValid.ps1'
Unpacking helpers\functions\Get-ChocolateyUnzip.ps1 to 'C:\ProgramData\chocolatey\helpers\functions\Get-ChocolateyUnzip.
ps1'
Unpacking helpers\functions\Get-ChocolateyWebFile.ps1 to 'C:\ProgramData\chocolatey\helpers\functions\Get-ChocolateyWebF
@TheBigBear
TheBigBear / Dockerfile_vboxfs.tmpl
Last active August 29, 2015 13:59 — forked from nsfmc/Dockerfile.tmpl
Seeking to get a boot2docker iso file for my Mac to allow me to boot a modified tinycore linux image that has the virtual box fs drivers for using shared folders already included
# $VBOX_VERSION should probably be something like 4.3.10 or somesuch
#
FROM boot2docker/boot2docker-rootfs
RUN apt-get install p7zip-full
RUN mkdir -p /vboxguest && \
cd /vboxguest && \
curl -L -o vboxguest.iso http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso && \
7z x vboxguest.iso -ir'!VBoxLinuxAdditions.run' && \
sh VBoxLinuxAdditions.run --noexec --target . && \