Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Install PowerShell Core via npm, allowing you to use it in npm scripts and node projects.
Install PowerShell Core via npm, allowing you to use it in npm scripts and node projects.
npm i -g pwsh
may be the easiest way to get started with PowerShell Core on any platform.
I prefer PowerShell to bash for quickly writing npm scripts. (opinion) However, I can't expect collaborators to have it installed.* Adding "pwsh"
as a "devDependency"
solves that problem without any extra effort.
We support both global and local npm installations, and we use a shared cache to avoid downloading duplicate copies of the full pwsh
distribution. This means you can install us as a local dev dependency in dozens of projects, and the installation process will quickly create a symlink to the cache.
* Even on Windows, the aging "Windows PowerShell" is preinstalled but we want to use pwsh
/ PowerShell Core, the cross-platform, more up-to-date edition of PowerShell.
If you just want to use pwsh
for your npm scripts, add us as a devDependency:
npm install --save-dev pwsh
If you want pwsh
to be globally available as an interactive shell:
npm install --global pwsh
All installations are shared, so you can depend on "pwsh" in many projects without downloading multiple copies of pwsh
. See the FAQ for details.
// Example package.json
{
"devDependencies": {
// Use the latest pwsh to install pwsh 6.0.4
"pwsh": "pwsh6.0.4"
},
"scripts": {
"test": "pwsh -NoProfile ./scripts/test.ps1"
}
}
--global
installations go into your npm prefix:
Local installations are cached in "$HOME/.npm-pwsh". We use your $HOME directory because Linux and Mac, by default, require root for global installations, so the npm prefix isn't writable.
Installation is merely extracting the .zip or .tar.gz download from PowerShell Core's Github releases. No scripts are run; your system is not modified.
# To view globally installed versions on Linux and Mac
cd "$(npm get prefix)/lib/node_modules/@cspotcode/pwsh-cache"
ls # shows all the versions installed
Installations are cached and shared, so if you work on 5 different projects that all depend
on "pwsh", only a single copy of pwsh
will be downloaded. Subsequent npm install
s should be very fast, merely creating a symlink at "./node_modules/.bin/pwsh".
PowerShell Core is about 50MB to download; 127MB extracted.
By default we install the latest version of PowerShell Core. To install a specific version -- including prereleases -- check the dist-tags and install the one you want.
npm install pwsh@pwsh6.2.0-preview.1
*Remember, npm dist-tags !== npm versions.
We are not running sudo apt-get
, brew install
, etc. So it's possible PowerShell will complain about unmet dependencies that we're unable to provide. For context, checkout out issue #8.
FAQs
Install PowerShell Core via npm, allowing you to use it in npm scripts and node projects.
The npm package pwsh receives a total of 1,106 weekly downloads. As such, pwsh popularity was classified as popular.
We found that pwsh demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.