Skip to content

Patch PowerShell example does not work on Windows #17630

@lfshr

Description

@lfshr

This is a Bug Report

kubectl PowerShell example does not work in Windows. cat is an alias for Get-Content, which by default parses a file line-by-line.

Proposed Solution:
Change PowerShell example to use the -Raw flag in Get-Content cmdlet (and change cat to Get-Content to avoid ambiguity between the Windows Get-Command alias and Unix cat command).

kubectl patch deployment patch-demo --patch $(Get-Content patch-file.yaml -Raw)

Page to Update:
https://kubernetes.io/docs/tasks/run-application/update-api-object-kubectl-patch/

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.priority/backlogHigher priority than priority/awaiting-more-evidence.sig/windowsCategorizes an issue or PR as relevant to SIG Windows.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions