invoke-webrequest : The response content cannot be parsed because the Internet Explorer engine is not available, or Internet Explorer's first-launch configuration is not complete. Specify the UseBasicParsing parameter and try again.
What needs to be done in order for webRequest-invoke to work? Does it have anything to do with the -useBasicParsing option of invoke-webRequest?
In a previous attempt to execute this command, Settings->Activation told me: A known error with Windows activation is: We can't activate Windows on this device as we can't connect to your organization's activation server. (or something similar to that). So, I had also to enter the following to fix that:
… slmgr.vbs /dlv
Check current license state again
PS C:\users\rene> cscript -nologo $env:windir\system32\slmgr.vbs -xpr
The machine is permanently activated.
Capslock needs to be swapped with ESC, the right Windows key needs to function as control key: Use this PowerShell script to change the registry accordingly (requires administrator privileges).
2024-03-29: In Windows 11, I had the problem that months after executing these command a third item appeared in the language bar: Swissgerman with US Keyboard.
Unfortunately, I was unable to get rid of the third item by running the Powershell commands again.
It seemd to finally disappear by going to Settings -> Time & language -> Language & region -> Choosing «deutsch» in Windows display language and the remove the US keyboard from there - but only to be completely messed up aftwards.
#
# No substitutes
# Remove entire key 'HKCU\Keyboard Layout\Substitutes' and add an empty one
#
remove-item -path 'HKCU:\Keyboard Layout\Substitutes'
$eatMe = new-item -path 'HKCU:\Keyboard Layout\Substitutes'
#
# Remove HKCU\Keyboard Laoyout\Preload
# Strangly, this remove-item does not seem to entirely remove
# the specified key:
#
remove-item -path 'HKCU:\Keyboard Layout\Preload'
#
# Add US and Swiss German keyboard layouts
#
new-itemProperty -path 'HKCU:\Keyboard Layout\Preload' -name 1 -value ('0000' + '0409') # US
new-itemProperty -path 'HKCU:\Keyboard Layout\Preload' -name 2 -value ('0000' + '0807') # German (Switzerland)
Language bar
#
# Language Bar
#
$null = new-itemProperty -path 'HKCU:\Software\Microsoft\CTF\LangBar' -name ShowStatus -value 4 -propertyType DWord -force # Docked in the Taskbar
$null = new-itemProperty -path 'HKCU:\Software\Microsoft\CTF\LangBar' -name Label -value 1 -propertyType DWord -force # Show text labels on the Language Bar
$null = new-itemProperty -path 'HKCU:\Software\Microsoft\CTF\LangBar' -name ExtraIconsOnMinimized -value 0 -propertyType DWord -force # Don't »Show additional Language bar icons in the taskbar«
Create a bin directory under %UserProfile% to store executables and scripts so that they can be called from the command line (such as cmd.exe or PowerShell).
Download a utility to change file type associations on the command line
In order to be able to change file type associations (FTAs) on the command line, a utility is needed. Such a functionality is provided by PowerShell scriptPS-SFTA.
PS:> set-FTA applications\code.exe .sql
SetUserFTA.exe
Another utility is SetUserFTA.exe which can be downloaded from SetUserFTA.exe:
TODO: the following download takes quite a bit of time, and System.Net.WebClient is deprecated anyway. So, try to use downloadFile(), found in the temp-scripts-and-utilities repository.
Download the self extracting executable. There is a portable git, an «ordinary installer» and more. These have their own version number, find newest version number here.
$gitVersion = '2.29.2' # Find newest version number under https://github.com/git-for-windows/git
$gitSubVersion = 2
if ([environment]::Is64BitOperatingSystem) {
# $ua.downloadFile("https://github.com/git-for-windows/git/releases/download/v$gitVersion.windows.$gitSubVersion/Git-$gitVersion-64-bit.exe" , "$($downloadFolder)Git.exe")
# $ua.downloadFile("https://github.com/git-for-windows/git/releases/download/v$gitVersion.windows.$gitSubVersion/Git-$gitVersion-64-bit.exe" , "$($downloadFolder)Git.exe")
$ua.downloadFile("https://github.com/git-for-windows/git/releases/download/v$gitVersion.windows.$gitSubVersion/PortableGit-$gitVersion.$gitSubVersion-64-bit.7z.exe", "$($downloadFolder)PortableGit.7z.exe")
#
# There would also be a .tar.bz2 file:
#
# $ua.downloadFile("https://github.com/git-for-windows/git/releases/download/v$gitVersion.windows.1/Git-$gitVersion-64-bit.tar.bz2", "$($downloadFolder)Git.exe")
# LFS Git does not seem necessary enymore
# $ua.downloadFile("https://github.com/git-lfs/git-lfs/releases/download/v2.7.2/git-lfs-windows-amd64-v2.7.2.zip", "$home\Downloads\git-lfs-windows-amd64.zip")
#
# TODO does the downloaded file really need to have the *amd64* thingy?
#
# $ua.downloadFile("https://github.com/git-lfs/git-lfs/releases/download/v/git-lfs-windows-amd64-v2.7.1.zip", "$home\Downloads\git-lfs-windows-amd64.zip")
} else {
# echo "64 bit expected"
$ua.downloadFile("https://github.com/git-for-windows/git/releases/download/v$gitVersion.windows.1/Git-$gitVersion-32-bit.exe", "$($downloadFolder)Git.exe")
}
Install «ordinary» git
Run the downloaded executable (which installs the git executable under C:\Program Files\Git\cmd).
The usr\bin directory under a Git installation has interesting tools such as diff. Thus, …\usr\bin might be added to the PATH environment variable so that these tools are available in a command line environment.
Install git lfs
cd ... data.stadt-zuerich.ch
git lfs install --local
Configure Git
Do long paths have to be enabled on Windows 10 with git?
git config --system core.longpaths true
Possibly, username and password need to be configured, too:
Install a portablePerl. Strawberry's portable Perl claims that it does not need admin privileges.
Strawberry recommends to put into path without spaces. However, the value of $env:programFiles is C:\Program Files which contains spaces - and I seem to remember that I was able to successfully install Perl below that directory.
# $strawberryPerlDestDir="$env:programFiles\StrawberryPerl"
$strawberryPerlDestDir="$home\StrawberryPerl"
$null = mkdir $strawberryPerlDestDir
#
# Find perl version under strawberryperl.com/releases.html
#
$perlVersion='5.30.3.1'
if ([environment]::Is64BitOperatingSystem) {
$ua.downloadFile("http://strawberryperl.com/download/$perlVersion/strawberry-perl-$perlVersion-64bit-PDL.zip" , "$downloadFolder\StrawberryPerl.zip")
} else {
$ua.downloadFile("http://strawberryperl.com/download/$perlVersion/strawberry-perl-$perlVersion-32bit-PDL.zip" , "$downloadFolder\StrawberryPerl.zip")
}
#
# Unzip zip file with COM object shell.application
#
$shell = new-object -comObject shell.application
$shell.nameSpace($strawberryPerlDestDir).copyHere($shell.nameSpace("$downloadFolder\StrawberryPerl.zip").items())
#
# Other dissapointing trials to unzip zipfile were:
#
# extrac32 $home\Downloads\StrawberryPerl.zip "$env:programFiles\StrawberryPerl"
# &rundll32.exe zipfldr.dll,RouteTheCall $home\Downloads\StrawberryPerl.zip
rm $home\Downloads\StrawberryPerl.zip
#
# Set env variables
#
# portableshell.bat also sets these variables:
# set TERM=
# set HOME=%~dp0data
#
$envTarget = 'user' # or 'machine'
addDirToPath $strawberryPerlDestDir\perl\site\bin
addDirToPath $strawberryPerlDestDir\perl\bin
addDirToPath $strawberryPerlDestDir\c\bin
# $envPath = [environment]::getEnvironmentVariable('PATH', $envTarget)
# [environment]::setEnvironmentVariable('PATH' , "$strawberryPerlDestDir\perl\site\bin;$strawberryPerlDestDir\perl\bin;$strawberryPerlDestDir\c\bin;$envPath", $envTarget)
[environment]::setEnvironmentVariable('PLPLOT_LIB' , "$strawberryPerlDestDir\c\share\plplot", $envTarget)
[environment]::setEnvironmentVariable('PLPLOT_DRV_DIR', "$strawberryPerlDestDir\c\share\plplot", $envTarget)
Associate .pl extension with Perl executable
TODO: This should now probably be done with SetUserFTA.exe.
The ARCH=native option is passed to gcc via the -march option. Additionally, it prevents the make file from trying to invoke sed which is not yet installed.
Define XPM=no to prevent fatal error: xpm.h: no such file or directory.
The option TERMINAL=yes builds vim with terminal support (winpty, :help terminal)
The default installation folder is C:\Program Files (x86)\Vim. Without administrator rights, another installation folder is needed, for example %homedrive%%homepath%\Vim.
Apparently, the installer does not set adjust the PATH variable. So, it needs to be set manually:
$ua.downloadFile('https://www.uwe-sieber.de/files/removedrive.zip', "$downloadFolder\removedrive.zip");
#
# Extract only exe from zip file. Note: there is also a 32-bit version
#
$removedrive_exe=$shell.namespace("${downloadFolder}removedrive.zip").items().item('x64\RemoveDrive.exe');
$shell.nameSpace($binPath).copyHere($removedrive_exe);
Enable the system global flagmaintain objects list so that openfiles.exe is able to report blocking files. Note, this requires a reboot to take effect: