cannot Importing WASP module - is there a replacement? - windows

I am trying to import WASP module (https://archive.codeplex.com/?p=wasp) but no luck.
is there a special instructions for installing it?
Moreover is there a replacement? as it is archived.

easiest way is to use chocolatey, if you get stuck, follow the instructions here:
https://chocolatey.org/install
1) Install chocolatey from PowerShell:
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
2) Install WASP form PowerShell as admin:
choco install wasp
3) Then run the following commands:
$WASP="C:\ProgramData\chocolatey\lib\wasp"
$Reflection="C:\ProgramData\chocolatey\lib\reflection"
$Autoload="C:\ProgramData\chocolatey\lib\Autoload"
Copy-Item $WASP C:\Windows\System32\WindowsPowerShell\v1.0\Modules -Recurse
Copy-Item $Reflection C:\Windows\System32\WindowsPowerShell\v1.0\Modules -Recurse
Copy-Item $Autoload C:\Windows\System32\WindowsPowerShell\v1.0\Modules -Recurse
Import-Module WASP
That's it, you should be golden after that, alternatively, you may download the .nupkg package and the .dll and placing them in the modules of powershell, you can use Nug PAckage explorer or change the .nupkg extension to .zip (lol).

Related

.NET 4.8 SDK install returns code 8196 while building windows docker image

I am creating a windows based docker image. The image is being created on top a another image which has .NET runtime already installed on it.
As part of DockerFile, there are a few other tools being installed before .NET 4.8 SDK installation begins. Following is the gist of DockerFile.
FROM <<company's docker repo for base windows image with .NET runtime>>
WORKDIR "C:\\WORKSPACE\\"
choco feature disable --name showDownloadProgress
# install all necessary software used in jenkins agent to build id-identity
# A few RUN choco install commands to install some tools...
RUN refreshenv
# A few pip install commands to install python libraries
# enable dotnet 3.5
RUN powershell Set-Service -Name wuauserv -StartupType Manual && powershell DISM /Online /Enable-Feature:NetFx3 /All
# add the dotnet sdk 4.8. The one that cloudos has is only runtime, we need sdk
ADD https://go.microsoft.com/fwlink/?linkid=2088517 'C:\\Download\\dotnet48_sdk.exe'
RUN C:\Download\dotnet48_sdk.exe /q /norestart
# Download the Build Tools bootstrapper.
ADD https://aka.ms/vs/16/release/vs_buildtools.exe 'C:\\Download\\vs_buildtools.exe'
# Install Build Tools with WebBuildTools
RUN C:\Download\vs_buildtools.exe \
--quiet --wait --norestart --nocache --installPath \
C:\BuildTools --add Microsoft.VisualStudio.Workload.WebBuildTools
# Download dotcover, which will be used to run the test coverage
# download nuget
ADD https://dist.nuget.org/win-x86-commandline/latest/nuget.exe "C:\\Nuget\\"
RUN setx path "%path%;C:\\Nuget\\"
RUN setx path "%path%;C:\\BuildTools\\MSBuild\\Current\\Bin\\"
ENTRYPOINT ["cmd.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"]
The error is reported on line
RUN C:\Download\dotnet48_sdk.exe /q /norestart
Following is the exact error text reported by Jenkins pipeline.
The command 'cmd /S /C C:\Download\dotnet48_sdk.exe /q /norestart' returned a non-zero code: 8196
I have looked for this errorcode all over but could not find meaning of it or fix for it.
Any clue about this will be very helpful.

Can't enable AzPredictor

Enable-AzPredictor: The 'Enable-AzPredictor' command was found in the module 'Az.Tools.Predictor', but the module could not be loaded. For more information, run 'Import-Module Az.Tools.Predictor'.
How can I fix this issue?
For anyone that might be having this issue, there are two externally managed, dependent modules for Az.Tools.Predictor :
1.Az.Accounts
2.PSReadLine
Also, i believe Az.Tools.Predictor requires Powershell 7.2 (minimum version) to run.
Check that you have these updated and that you are using Powershell Core.
If you need to uninstall and install it again you try these steps:
#open cmd as admin and open pwsh with no profile:
pwsh -noprofile
#uninstall any previous installations of Az.Tools.Predictor
Uninstall-Module -Name Az.Tools.Predictor -Force
#install latest version of PSReadline:
Install-Module -Name PSReadline -Force
#install Az.Tools.Predictor
Install-Module -Name Az.Tools.Predictor -verbose
*verbose here, will let you know where the module was installed.
#open new powershell core window
Enable-AzPredictor -AllSession
Hope this helps.

how to install pnpm without first installing npm

I am sitting in front of a completely clean windows 10 install – VS Code is installed but nothing else:
Is it possible to install and use pnpm without installing npm?
Is doing that a good thing or bad thing? context - typescript
There's a standalone script on pnpm installation guide.
curl -L https://unpkg.com/#pnpm/self-installer | node
Windows doesn't have curl, instead you can use Invoke-WebRequest within PowerShell for that. So probably this should work:
Invoke-WebRequest -Uri https://unpkg.com/#pnpm/self-installer | node
Update
Try downloading file instead and then executing it with node:
Invoke-WebRequest -Uri https://unpkg.com/#pnpm/self-installer -OutFile pnpm.js; node pnpm.js
Your second question is unclear.
Another approach is using COREPACK
corepack enable pnpm

How to install Watchman on Windows (win10)?

I am trying to install Watchman to my computer for npm for React Native. I opened the docs http://facebook.github.io/watchman/docs/install.html and can't understand how it should be done.
Could you please explain me more detailed?
For those using Chocolatey
(this is not published on the website yet, but found the info in the github repo):
Watchman is available to install via the Chocolatey Windows package manager. Installation is as simple as:
PS C:\> choco install watchman
Reference: https://github.com/facebook/watchman/blob/573b18b86b88759f31e83fa2e1837539d138de22/website/_docs/install.markdown#installing-on-windows-via-chocolatey
Beware that installing Chocolatey itself is somewhat tedious, but here is the link if you'd like to give it a go:
https://chocolatey.org/courses/installation
Load watchman archive by this instruction https://facebook.github.io/watchman/docs/install#binary-downloads-for-linux-macos-and-windows-beta
Create folder watchman in c:\Users\USERNAME\AppData\Local
Extract watchman archive to watchman folder. You must get c:\Users\USERNAME\AppData\Local\watchman\watchman.exe
Open path environment in
click on luppa (find) and insert settings: Edit the system environment variables -> Environment variables
OR System -> System Info -> Advance system settings -> Advance (tab) -> Environment variables
Set add to enviroment path c:\Users\USERNAME\AppData\Local\watchman
Re login in you system or reboot PC
Open terminal and run command watchman -v and you must see version
Here is the official guide to download Watchman on Windows.
Anyway I would post here not only how to download watchman but also the correct installation of it (the first steps I will copy from the official guide)
Go to https://github.com/facebook/watchman/actions?query=is%3Asuccess+event%3Apush+branch%3Amaster
Click on the CI label (the first CI label you can see)
2.1 Press on the first item you see. In the example is: "Updating submodules Summary: Github commits...
2.2 Choose "Windows"
3.Look in the top right of the resulting page for the Artifacts drop down
Click it to reveal the download artifacts link
5.Click that and extract the zip file
Now it comes the most important part that the official guide does not explain:
After
Extract the zip file and make sure that watchman.exe is located in a
directory that is in your PATH.
Go to C:\Users\YOUR_USERNAME\AppData\Local\
Create a folder called "watchman"
Copy there the files you've extracted (the most important one is watchman.exe)
So in your watchman folder, you'll have
Open Windows PowerShell as Administrator (If you don't have administrator privileges you can see the edit answer)
Now We'll create an environment variable so you can access watchman from anywhere. here is where setx comes in.
Copy and paste the following command (replace your username!)
setx path "%path%;C:\Users\YOUR_USERNAME\AppData\Local\watchman"
If everything is ok, you'll se a success message
Restart your computer
After restarting you can open again Windows PowerShell and run the following command:
watchman -v
If you can see the version, you've been installed watchman correctly
EDIT
Thanks #airstrike for your suggestion in the comments
You can run dialog (press Win+R) and type in
Rundll32 sysdm.cpl,EditEnvironmentVariables
Then create your user environment seeting the following path: C:\Users\YOUR_USERNAME\AppData\Local\watchman
Continue with the Step 7
You have to install Linux Bash Shell on Windows 10
After that run the following command on Bash
apt-get install python-dev libtool m4 automake pkg-config
git clone https://github.com/facebook/watchman.git
cd watchman/
git checkout v4.9.0
./autogen.sh
./configure
make
sudo make install
After a while I found the latest zip is here:
https://github.com/facebook/watchman/actions?query=is%3Asuccess+event%3Apush+branch%3Amaster
The latest version of watchman didn't have the watchman.exe file in it. So please use https://github.com/facebook/watchman/releases/tag/v2021.01.11.00 to download watchman and follow the instructions in #Andrey Patseiko's answer.
Watchman on Windows is currently in an alpha state. The link from the installation page links to this issue; the instructions are in the top post:
https://github.com/facebook/watchman/issues/19
If you are not comfortable following those instructions, then using Watchman is not yet for you.
You can install watchman on windows 10 with command below.
choco install watchman
You need to have choco installed already.
Unless, you should install choco with command below.
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
You would have to run Powershell in administrator mode and then run the following commands:
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
Then close the PowerShell terminal and reopen it in administrator more again and run this command:
choco install watchman

Where is the cygwin setup.exe binary when installed with the Chocolatey package manager?

I am working on a system automation process which will use Powershell to install Chocolatey to install Cygwin. I would subsequently like to install the prerequisites for apt-cyg, which will allow me to programatically install packages from cygwin. However, I do not know where the setup.exe binary for Cygwin is placed when installed with Chocolatey.
I downloaded the cygwin package and inspected the chocolateyInstall.ps1. Looks like the package downloads the exe installer and passes the target folder.
$binRoot = Get-BinRoot
$cygRoot = join-path $binRoot "cygwin"
$cygPackages = join-path $cygRoot packages
# https://cygwin.com/faq/faq.html#faq.setup.cli
$silentArgs = "-q -R $cygRoot -l $cygPackages -s http://mirrors.kernel.org/sourceware/cygwin/"
$validExitCodes = #(0)
Install-ChocolateyPackage "$packageName" "$installerType" "$silentArgs" "$url" "$url64" -validExitCodes $validExitCodes
The target folder is combined using the Chocolatey "binroot" folder. Here's where this gets messy... There are a bunch of legacy locations for this folder. The foolproof method is to import the Chocolatey helper module and execute Get-BinRoot. You need to find your Chocolatey install folder, too.
PS> Import-Module $ENV:CHOCOLATEYINSTALL\chocolateyInstall\helpers\chocolateyInstaller.psm1; Get-BinRoot
That will dump a folder name, on my system (and most systems with the latest Chocolatey and no manual changes to that path or any other Environment variables)
C:\tools
So, the cygwin binaries should be under some path like
C:\tools\cygwin
FYI, the cygwin package does recommend installing the cyg-get package for this kind of thing.
It's not an answer to where you can find the setup.exe, but you can actually use some package manager for Cygwin to manage packages. Some of them are standalone applications or scripts, some of them are just wrappers around Cygwin's setup.exe. Check my answer to How do I install cygwin components from the command line? for a list of some of them.
Also, there is the cyg-get in the Chocolatey's repository, which is, in fact, a wrapper around the setup.exe written in PowerShell.

Resources