Can't enable AzPredictor - windows

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.

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.

How to install specific version of windows sdk using chocolatey?

I have C++ project with its target platform version type as 10.0.15063.0 and target platform as Windows 10.
I tried to create a azure pipeline that builds and publishes the artifacts, but I am facing issue to install windows sdk of specific version using choco(i.e 10.0.15063.x).
command tried :
choco install windows-sdk-10.0 --version=10.0.15063
I am getting error saying the package not found in the sources listed. Is there any way to fix the issue.
The version 10.0.15063.0 is not in the choco package list. As an alternative, you can download the installation from link, and install it via command.
Download bash command:
curl -LO "https://download.microsoft.com/download/E/1/B/E1B0E6C0-2FA2-4A1B-B322-714A5586BE63/windowssdk/winsdksetup.exe"
chmod 777 winsdksetup.exe # add permission for execution
Install in powershell silently:
Start-Process winsdksetup.exe -ArgumentList "/q" -Wait
Verify the version on my local machine:
However, the version number is strange, it shows 10.1.15063 actually in control panel.
So I can install it with choco command instead:
choco install windows-sdk-10.1 --version=10.1.15063.468 -y
Please check the version in regedit and control panel.
Doesn't look like that version is available. You can confirm this by searching for the package and listing all versions using choco list or choco search (search and list are synonyms for choco.exe):
choco list -a windows-sdk-10.0
Today, only one version is available: 10.0.26624. You can try to get the attention of the package maintainer on the package listing via the comments or Contact Maintainers link in the sidebar to update it or you can build your own and host on an internal feed for your use case.

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

cannot Importing WASP module - is there a replacement?

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).

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

Resources