powershell

How to create a powershell script / or windows .bat file for ffmpeg

岁酱吖の 提交于 2021-02-11 06:31:26
问题 So, I want to create a Powershell or Batch file (whichever works best for the task), that I can paste in a folder and after executing it, will start to use FFmpeg to encode all videos The part that works (in .bat): for %%a in ("*.mkv") do( ffmpeg -i "%%a" -c:v libx265 -c:a copy -x265-params crf=25 "%%a [encoded].mkv" pause) This works, but in some folders, I already have [encoded] files. I'd like for the script to skip these files. I asked in reddit and received the following script: for %%a

'Session' Parameter is null or empty in PowerShell script

爷,独闯天下 提交于 2021-02-11 05:28:38
问题 I'm very new to PowerShell (forgive my ignorance) and am trying to install a program remotely on multiple computers on my domain. Currently, I'm just trying to get it to work on one computer. The script below was found online and adapted for my needs. Yesterday it worked, but today it's complaining about the session parameter. I don't fully understand "sessions", but I have ensured on the client machine that the winrm service is running and I have invoked Enable-PSRemoting -force . Here's the

How to write a secret to azure key vault from Azure DevOps pipeline?

£可爱£侵袭症+ 提交于 2021-02-11 04:56:31
问题 I have created a Key Vault in Azure DevOps using ARM and I now want to write a secret to it within the same pipeline. I created an Azure PowerShell task with the following inline PowerShell: $secretvalue = ConvertTo-SecureString $(Secret) -AsPlainText -Force Set-AzureKeyVaultSecret -VaultName $(VaultName) -Name $(SecretName) -SecretValue (ConvertTo-SecureString $(Secret) -AsPlainText -Force) The key vault gets created fine, but I get the following error when trying to write the secret: [error

Powershell Copy-Item -Destination [duplicate]

不打扰是莪最后的温柔 提交于 2021-02-10 23:18:32
问题 This question already has answers here : Powershell 2 copy-item which creates a folder if doesn't exist (9 answers) Closed 3 years ago . Get-ChildItem -Path \\$SiteMachineName\c$\ProgramData\Scripts\log -Recurse | Where-Object {$_.LastWriteTime -gt (Get-Date).AddDays(-40)} | select * | Select -ExpandProperty FullName | Copy-Item -Destination C:\Users\<username>\Desktop\PS This is the script I'm trying to run, It grabs all the files older then 40 days from the script folder on a remote machine

Powershell Copy-Item -Destination [duplicate]

本小妞迷上赌 提交于 2021-02-10 23:17:57
问题 This question already has answers here : Powershell 2 copy-item which creates a folder if doesn't exist (9 answers) Closed 3 years ago . Get-ChildItem -Path \\$SiteMachineName\c$\ProgramData\Scripts\log -Recurse | Where-Object {$_.LastWriteTime -gt (Get-Date).AddDays(-40)} | select * | Select -ExpandProperty FullName | Copy-Item -Destination C:\Users\<username>\Desktop\PS This is the script I'm trying to run, It grabs all the files older then 40 days from the script folder on a remote machine

Convert all files in a directory using ffmpeg and then move them using PowerShell

瘦欲@ 提交于 2021-02-10 22:40:53
问题 I want to create a script that converts .mkv-files from x264 to x265 using ffmpeg-windows. To generate a list of all files in the directory I created a .ps1-script generate-list.ps1 , you might want to use it. What must my powershell script be to execute the code stated below for each item in the folder video_old and move it to video_new after conversion? del .\list.txt cd .\video_old\ foreach ($i in Get-ChildItem .\*.mkv) {echo "file '$i'" >> "list.txt"} move .\list.txt ..\ cd .. The

PowerShell debug execution

為{幸葍}努か 提交于 2021-02-10 22:11:41
问题 Trying to use module PSColor , I get the error Value cannot be null. Parameter name: command En línea: 39 Carácter: 9 + $steppablePipeline.Begin($PSCmdlet) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~` as mentioned in PowerShell New-CommandWrapper : Supply values for the following parameters How can I trace execution of commands, to find the culprit and fix the problem? What I tried: I added Set-PSDebug -Trace 2 -Strict at the top of my profile.ps1 . Enabled line Import-Module PSColor in profile.ps1

Powershell Textbox placeholder

删除回忆录丶 提交于 2021-02-10 20:42:39
问题 I create my from, define my TextBoxes, and for my placeholder text I'm using the following code: $AssetText.Add_MouseClick({ $AssetText.text = “” }) $ErrorText.Add_MouseClick({ $ErrorText.text = “” }) $IssueText.Add_MouseClick({ $IssueText = “” }) $TestTagText.Add_MouseClick({ $TestTagText.text = “” }) $TroubleshootText.Add_MouseClick({ $TroubleshootText.text = “” }) $ResolutionText.Add_MouseClick({ $ResolutionText.text = “” }) It works to remove text from the TextBox, but if I type a fair

Powershell Textbox placeholder

旧城冷巷雨未停 提交于 2021-02-10 20:41:32
问题 I create my from, define my TextBoxes, and for my placeholder text I'm using the following code: $AssetText.Add_MouseClick({ $AssetText.text = “” }) $ErrorText.Add_MouseClick({ $ErrorText.text = “” }) $IssueText.Add_MouseClick({ $IssueText = “” }) $TestTagText.Add_MouseClick({ $TestTagText.text = “” }) $TroubleshootText.Add_MouseClick({ $TroubleshootText.text = “” }) $ResolutionText.Add_MouseClick({ $ResolutionText.text = “” }) It works to remove text from the TextBox, but if I type a fair

Split a Path and take out only the last part (filename) Powershell

故事扮演 提交于 2021-02-10 19:58:55
问题 I'm very new to powershell and im currently trying to write a script that finds a referenced filepath in a file, takes out only the last part of the path (The filename) and moves it to the same destination like the folder containing it. I have a functional script that does what i want, the only thing left is that its not supposed to look for the whole path of the referenced file. Because the path isnt correct anymore. It should just look for the filename and find and move it. This is my