POSH | A meta project for the POSH related projects
kandi X-RAY | POSH Summary
kandi X-RAY | POSH Summary
A meta project for the POSH related projects. Mostly pointers and install scripts.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of POSH
POSH Key Features
POSH Examples and Code Snippets
Community Discussions
Trending Discussions on POSH
QUESTION
Assuming Get-Foo
and Get-Foo2
and Deploy-Jobs
are 3 functions that are part of a very large module. I would like to use Get-Foo
and Get-Foo2
in Deploy-Jobs
's Start-ThreadJob
(below) without reloading the entire module each time.
Could someone please show me a working example of how to do this?
...ANSWER
Answered 2022-Apr-15 at 23:02The method you can use to pass the function's definition to a different scope is the same for Invoke-Command
(when PSRemoting), Start-Job
, Start-ThreadJob
and ForeEach-Object -Parallel
. Since you want to invoke 2 different functions in your job's script block, I don't think -InitializationScript
is an option, and even if it is, it might make the code even more complicated than it should be.
You can use this as an example of how you can store 2 function definitions in an array ($def
), which is then passed to the scope of each TreadJob, this array is then used to define each function in said scope to be later used by each Job.
QUESTION
I have a DirectX 12 desktop project on Windows 11 that implements post-processing using a combination of DXTK post-process effects.
The aim of the post-proc sequence is to end up with individual bloom and blur textures (along with a depth texture rendered in a depth pass) which are sampled in a 'big triangle' pixel shader to achieve a depth of field effect for the final backbuffer screen image.
The DXTK PostProcesses operate on the full-size (1920x1080) screen texture. Presently this isn't impacting performance (benchmarked at 60fps), but I imagine it could be an issue when I eventually want to support 4K resolutions in future, where full-size image post-processing could be expensive.
Since the recommended best practice is to operate on a scaled down copy of the source image, I hoped to achieve this by using half-size (i.e. quarter resolution) working textures with the DownScale_2x2 BasicPostProcess option. But after several attempts experimenting with the effect, only the top-left quarter of the original source image is being rendered to the downsized texture... not the full image as expected per the documentation:
DownScale_2x2: Downscales each 2x2 block of pixels to an average. This is intended to write to a render target that is half the size of the source texture in each dimension.
Other points of note:
- scene geometry is first rendered to a _R16G16B16A16_FLOAT MSAA render target and resolved to single-sample 16fp target
- postprocessing operates on resolved single-sample 16fp target (where only the intermediate 'Pass1' & 'Pass2' working render targets are set to half the backbuffer length & width)
- final processed image is tonemapped to the _R10G10B10A2_UNORM swapchain backbuffer for presentation.
The following code snippets show how I'm implementing the DownScale_2x2 shader into my post-process. Hopefully it's enough to resolve the issue and I can update with more info if necessary.
Resource initialization under CreateDeviceDependentResources():
...ANSWER
Answered 2022-Apr-11 at 21:53The PostProcess
class uses a 'full-screen quad' rendering model. Since we can rely on Direct3D 10.0 or later class hardware, it makes use of the 'self-generating quad' model to avoid the need for a VB.
As such, the self-generating quad is going to be positioned wherever you have the viewport set. The scissors settings are also needed since it uses the "big-triangle" optimization to avoid having a diagonal seam across the image IF you have the viewport positioned anywhere except the full render target.
I have this detail in the Writing custom shaders tutorial, but I forgot to replicate it in the PostProcess docs on the wiki.
TL;DR: When you go to render to the smaller render target, use:
QUESTION
ANSWER
Answered 2021-Aug-25 at 20:27There is a prompt
function in your $profile
(not by default but if you have a customized prompt you will). You will have to modify it to remove the code that writes (venv)
in your prompt.
QUESTION
As suggest here https://github.com/dahlbyk/posh-git/issues/106 I used
git restore 'stash@{0}' --
but still get
...ANSWER
Answered 2022-Mar-12 at 05:27You want git restore --source=stash@{0}
(which will require adding single quotes or whatever as usual for PowerShell). That is, your mistake here is leaving out --source=
.
Worth noting: stash@{0}
and stash
have exactly the same meaning, so there's no need to add the @{0}
part. If you leave it out, you won't run into PowerShell's special meaning for braces either, and won't need single quotes. So
QUESTION
I've created a Bicep template. In it I create a user-assigned identity and reference it in other resources like this
...ANSWER
Answered 2022-Jan-04 at 20:19So bicep does not require the dependsOn
segment if referencing the property correctly.
Need to reference the properties.principalId
of the userId in the resource block.
So would look like:
userId.properties.principalId
Here's a quickstart that calls out in a working example how this would work.
QUESTION
Searching for an answer to this finds a lot about GitHub credentials but nothing on this specific issue. I am starting to work with the PowerShell (PoSH) Cmdlet 'Get-Credential' because my company uses Two-factor Authentication (2FA), so a username/password won't work to remote from my desktop (user account) to a server (Admin account). Additionally, I have just started using VS Code. The issue is that when running a simple PoSH snippet, in PoSH ISE using Get-Credential I get a popup that lets me select the certificate that I need and then enter a Pin. When I run this same snippet in VS Code, the popup never appears. Does anyone understand why this is, and can I resolve it?
Here is the snippet for reference.
...ANSWER
Answered 2022-Jan-03 at 19:14You can show or hide the terminal from the "view" menu or using
QUESTION
I have the Posh-Git module installed for Powershell and, recently, I also installed Anaconda and did conda init
. Apparently, this modifies the profile.ps1
file by adding the following code:
ANSWER
Answered 2021-Dec-30 at 03:37The posh-git docs state that posh-git won't modify a custom prompt. So when you run Import-Module posh-git
after conda has initialized, you won't see anything change. The solution is to put Import-Module posh-git
before the conda initialization block in your $Profile.CurrentUserAllHosts
file so it looks like:
QUESTION
I am trying to create an automation runbook to backup one of our Azure Devops repository and store it as a Zip file in the storage account. But when I run Git clone in a runbook(imported the posh-git module)I am getting the below error. Is there any way I can download the whole git repo as a Zip file using Automation Runbook?
...ANSWER
Answered 2021-Dec-13 at 18:31I created a DevOps pipeline to clone, archive, and copy the repository to a storage account as a Zip file and set up 10 days retention for the Zip files. Below are the steps:
- Create a container in the Azure storage account.
- Generate a new PAT in Azure DevOps with 'Read' access to 'Code'
- Create a new service connection in Azure DevOps to access the Azure subscription that contains the storage account.
- Create a YAML pipeline with the code here.
QUESTION
I use Powershell 5.1 daily in Windows Terminal. However, since a few days, my Oh My Posh theme stopped working, and printed an error that said it couldn't find the theme that I wanted (iterm2), and falled back to a default theme.
I have removed (Remove-Module -Name oh-my-posh -Force
) and reinstalled (Install-Module -Name oh-my-posh -Scope CurrentUser
) Oh My Posh, but this hasn't fixed the problem. How to solve ?
Thanks
...ANSWER
Answered 2021-Dec-11 at 14:02It also happened to me. I got it fixed by manually downloading the themes in the right place.
If you want to make it easy, I created a powershell One-Liner that fixes it:
QUESTION
I have a field of product variant names.
'XS', 'S', 'M', 'S', 'M', 'S', 'M', 'XS', 'S', 'M', 'XS', 'S', 'M', 'L', 'XS', 'XS', 'XS', 'S', 'XL', 'XS', 'M', 'XS', 'S', 'M', 'XS', 'M', 'S', 'XS', 'M', 'Chick Black', 'Brave Blue', 'Bold Red', 'Posh Pink', 'Purple Yum', 'Blue', 'Good Green', 'Orange', 'Purple Yum', 'Red', 'Yellow', 'Red', 'Blue', 'Purple Yum', 'Good Green', 'Orange', 'Pink', 'Light Blue', 'Red', 'Yellow', 'Green Elipse', 'Light Blue', 'Pink', 'Orange', 'White', 'Green Elipse', 'Pink Elipse', 'Blue Elipse', 'Red', 'Yellow Elipse', 'Green Elipse', 'Blue Elipse', 'Pink Elipse', 'Orange', 'White', 'Blue', 'Mint Green', 'Dusty Pink', 'Airforce Blue', 'Claret', 'Pink', 'Rubine Red', 'Green MM', 'Grey', 'Blue', 'Orange', 'Yellow', 'Light Blue', 'Pink', 'Rubine Red', 'Green MM', 'Grey', 'Blue', 'Orange', 'Yellow', 'Light Blue', 'SA 10', 'SA 12', 'SA 14', 'SA 16', 'Blue Babyhood', 'Pink Babyhood'
I want to select id from the variants
table based on the list above. But when I do this query,
ANSWER
Answered 2021-Dec-06 at 11:04You can left join to an ad hoc derived table of the variant names. (Or inner join, if you don't want rows in the result for names that don't exist in variants
.)
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install POSH
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page