'Bypass Powershell to run zsh command

In Powershell(pwsh) Is it possible to "bypass" Powershell to not do anything and let the underlying shell do the work?

Sometime I need to call a command, that I copy from a site or other, that includes "\" and not "´" for line break - or other parameters, that Powershell try to interpolate.

Like:

 <Powershell Function> kubectl get rolebindings,clusterrolebindings \                                      
  --all-namespaces  \
  -o custom-columns='KIND:kind,NAMESPACE:metadata.namespace,NAME:metadata.name,SERVICE_ACCOUNTS:subjects[?(@.kind=="ServiceAccount")].name' | grep name


Solution 1:[1]

Not that I'm aware of. I also don't know of any shell where this is possible, either, save for Ruby where you have the string literal operators making escapes much easier.

I would suggest that before sending strings to external commands, that you convert the PowerShell escape sequences to the target runtime escape sequences. This isn't a problem unique to PowerShell, but is easier to work with in other shells because there is more of an overlap of the special characters between other runtimes.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Bender the Greatest