-
Notifications
You must be signed in to change notification settings - Fork 0
Add: PowerShell v7.6.4 #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -109,6 +109,26 @@ RUN curl -fsSL https://dot.net/v1/dotnet-install.sh -o /tmp/dotnet-install.sh \ | |||||||||||||||||||
| ENV DOTNET_CLI_TELEMETRY_OPTOUT=1 | ||||||||||||||||||||
| ENV DOTNET_NOLOGO=1 | ||||||||||||||||||||
|
|
||||||||||||||||||||
| # ----------------------------------------------------------------------------- | ||||||||||||||||||||
| # PowerShell | ||||||||||||||||||||
| # Cross-platform shell and scripting language built on .NET. | ||||||||||||||||||||
| # Installed via Microsoft GitHub releases for exact version pinning. | ||||||||||||||||||||
| # PowerShell uses x64/arm64 naming — maps from TARGETARCH with a remap | ||||||||||||||||||||
| # for amd64 (PowerShell calls it x64). | ||||||||||||||||||||
| # URL: https://github.com/PowerShell/PowerShell | ||||||||||||||||||||
| # ----------------------------------------------------------------------------- | ||||||||||||||||||||
| ARG POWERSHELL_VERSION=v7.6.4 | ||||||||||||||||||||
|
|
||||||||||||||||||||
| RUN PS_ARCH=$([ "${TARGETARCH}" = "arm64" ] && echo "arm64" || echo "x64") \ | ||||||||||||||||||||
| && curl -fsSL \ | ||||||||||||||||||||
| "https://github.com/PowerShell/PowerShell/releases/download/${POWERSHELL_VERSION}/powershell-${POWERSHELL_VERSION#v}-linux-${PS_ARCH}.tar.gz" \ | ||||||||||||||||||||
| -o /tmp/powershell.tar.gz \ | ||||||||||||||||||||
| && mkdir -p /usr/local/pwsh \ | ||||||||||||||||||||
| && tar -xzf /tmp/powershell.tar.gz -C /usr/local/pwsh \ | ||||||||||||||||||||
| && rm /tmp/powershell.tar.gz \ | ||||||||||||||||||||
| && ln -s /usr/local/pwsh/pwsh /usr/local/bin/pwsh \ | ||||||||||||||||||||
| && pwsh --version | ||||||||||||||||||||
|
Comment on lines
+127
to
+130
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🔴 Critical | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== Dockerfile relevant section =="
sed -n '100,140p' Dockerfile | cat -n
echo
echo "== PowerShell archive entries in local files, if present =="
python3 - <<'PY'
import tarfile, glob, os, zipfile, pathlib
for p in pathlib.Path('.').rglob('*.tar.gz'):
if 'powershell' in p.name.lower():
print(f"\n{T}--- {p}")
try:
with tarfile.open(p, 'r:gz') as tf:
for m in tf.getmembers():
if os.path.basename(m.name) in {'pwsh'} or any(part in {'pwsh'} for part in m.name.split('/')[max(0, len(m.name.split('/'))-3):]):
print(m.name, oct(m.mode), "dir?" if m.isdir() else "executable?" if m.isreg() else "other", stat.S_ISEXEC(m.mode) if m.isreg() else None)
except Exception as e:
print("ERR", e)
PY
echo
echo "== Repository references to pwsh/powershell =="
rg -n "pwsh|powershell|chmod|TARGETARCH|uname -m" Dockerfile Dockerfile* dependencies .github 2>/dev/null || true
echo
echo "== GitHub tag artifact entry modes if available =="
python3 - <<'PY'
import sys, urllib.request, json, tarfile, gzip, io, re
tag = "7.6.4"
prefixes = ["powershell/7.6.4/", ""]
names = [f"powershell-{tag}-linux-{arch}.tar.gz" for arch in ["x64","amd64","arm64"]]
print(f"Tag: {tag}")
for name in names:
url=f"https://github.com/PowerShell/PowerShell/releases/download/v{tag}/{name}"
print(f"\n-- {name} -- URL: {url}")
try:
with urllib.request.urlopen(url, timeout=20) as r:
data=r.read(2_097_152)
tf=tarfile.open(fileobj=io.BytesIO(data), mode='r:gz')
matches=[]
for m in tf.getmembers():
if os.path.basename(m.name) == 'pwsh':
matches.append((m.name, oct(m.mode), m.isreg()))
for mm in matches[:5]:
print(mm)
except Exception as e:
print("ERR", type(e).__name__, e)
PYRepository: Taegost/DevOps-Toolbox Length of output: 13640 🌐 Web query:
💡 Result: When installing PowerShell 7.6.4 on Linux using the tarball archive, you must manually set the executable permission bit on the pwsh binary after extraction [1][2][3]. While recent efforts have been made to address historical permission inconsistencies in Linux releases [4][5], the official Microsoft documentation continues to explicitly include a chmod instruction as part of the standard manual installation procedure [1][2][3]. To install PowerShell 7.6.4 and set the correct permissions, follow these steps: 1. Download the appropriate tar.gz archive for your Linux distribution and architecture (e.g., x64, arm64) from the official PowerShell GitHub releases page [1][3][6]. 2. Create a target directory (typically /opt/microsoft/powershell/7) and extract the archive into it [1][2][3]: sudo mkdir -p /opt/microsoft/powershell/7 sudo tar zxf /path/to/powershell-7.6.4-linux-x64.tar.gz -C /opt/microsoft/powershell/7 3. Set the required execute permissions on the pwsh executable [1][2][3]: sudo chmod +x /opt/microsoft/powershell/7/pwsh 4. Optionally, create a symbolic link to make pwsh accessible globally in your PATH [1][2][3]: sudo ln -s /opt/microsoft/powershell/7/pwsh /usr/bin/pwsh If you encounter issues where tab completion or other features fail to run, some users have reported needing to apply executable permissions to other files (such as.dll files) in the directory [7][8], although this is generally not required for the basic functionality of the pwsh binary itself [4][5]. Always prioritize using your distribution's native package repository (e.g., via apt, dnf, or yum) if possible, as these methods handle permissions automatically [9][10]. Citations:
Set execute permission after extracting PowerShell. Extract the archive before running Proposed fix && tar -xzf /tmp/powershell.tar.gz -C /usr/local/pwsh \
+ && chmod +x /usr/local/pwsh/pwsh \
&& rm /tmp/powershell.tar.gz \📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||
|
|
||||||||||||||||||||
| # ----------------------------------------------------------------------------- | ||||||||||||||||||||
| # gcloud CLI (Google Cloud SDK) | ||||||||||||||||||||
| # Installed via Google's versioned archive for exact version pinning. | ||||||||||||||||||||
|
|
||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: Taegost/DevOps-Toolbox
Length of output: 283
🏁 Script executed:
Repository: Taegost/DevOps-Toolbox
Length of output: 1154
Add the release-page comment above
POWERSHELL_VERSION..env.examplecurrently only tags this entry under# Programming languages, but the guideline requires a link to the release page for each tool version. Add a short comment above this line pointing to the PowerShell release page.🤖 Prompt for AI Agents
Source: Coding guidelines