powershell

QProcess: not receiving finished() signal running Powershell script

六月ゝ 毕业季﹏ 提交于 2021-02-20 04:34:06
问题 I am developing a Qt application that, among other things, converts an Excel spreadsheet in a text delimited with tab file. This is done by running a Windows Powershell script. My problem is that the finished() signal from the QProcess is never emitted, although the conversion is done successfully. And yes, I receive stateChanged() signal. Powershell script (ps_excel.ps1) (adapted from this question) param ([string]$ent = $null, [string]$sal = $null) $xlCSV = -4158 #value for tab delimited

Powershell | how to programmatically iterate through variable names [duplicate]

时光怂恿深爱的人放手 提交于 2021-02-20 04:04:48
问题 This question already has answers here : Define Powershell variable to have a value of a list (6 answers) Closed 2 months ago . I have this code: $a1 = "value1" $a2 = "value2" $a3 = "value3" $a4 = "value4" $a5 = "value5" DO { "Starting Loop $a1" $a1 $a1++ "Now `$a is $a1" } Until ($a1 -eq "value5") i try to make the loop stop once it reach value5 . The question is how i can go pass through all the variables, so if $a1 is not value5 it go to $a2 . Thanks. 回答1: What you're trying ⚠️ You might

How to count objects in text file using PowerShell

£可爱£侵袭症+ 提交于 2021-02-20 03:51:08
问题 I'm wondering how I can count a particular objects in the text file using PowerShell. For example, this is the file I have: Color: Black Length: Long Size: 30 Color: Blue Length: Long Size: 20 Color: Black Length: Short Size: 10 How do I "Color" that is "Black" ? The output should be 2 according to the file. 回答1: You can read the text as single multiline string and break it down into blocks on the empty line. Then do a simple regex to catch the string you want and get the Count property of

How to count objects in text file using PowerShell

穿精又带淫゛_ 提交于 2021-02-20 03:47:02
问题 I'm wondering how I can count a particular objects in the text file using PowerShell. For example, this is the file I have: Color: Black Length: Long Size: 30 Color: Blue Length: Long Size: 20 Color: Black Length: Short Size: 10 How do I "Color" that is "Black" ? The output should be 2 according to the file. 回答1: You can read the text as single multiline string and break it down into blocks on the empty line. Then do a simple regex to catch the string you want and get the Count property of

Get response link from HTTP request on Powershell

不羁的心 提交于 2021-02-20 03:44:46
问题 The following Powershell script runs a Google search of an image stored within my hard drive. How can I get the link which is followed to get to the results page? Is it possible to navigate to the different webpages displayed on it? I've tried $request.Links | Select href to try and get a list of the links, but it didn't work. I've also tried to add Write-Output $respStream to the code, but then it doesn't run. Set-ExecutionPolicy Bypass -scope Process -Force function Get-GoogleImageSearchUrl

Get response link from HTTP request on Powershell

故事扮演 提交于 2021-02-20 03:43:12
问题 The following Powershell script runs a Google search of an image stored within my hard drive. How can I get the link which is followed to get to the results page? Is it possible to navigate to the different webpages displayed on it? I've tried $request.Links | Select href to try and get a list of the links, but it didn't work. I've also tried to add Write-Output $respStream to the code, but then it doesn't run. Set-ExecutionPolicy Bypass -scope Process -Force function Get-GoogleImageSearchUrl

Get response link from HTTP request on Powershell

こ雲淡風輕ζ 提交于 2021-02-20 03:42:26
问题 The following Powershell script runs a Google search of an image stored within my hard drive. How can I get the link which is followed to get to the results page? Is it possible to navigate to the different webpages displayed on it? I've tried $request.Links | Select href to try and get a list of the links, but it didn't work. I've also tried to add Write-Output $respStream to the code, but then it doesn't run. Set-ExecutionPolicy Bypass -scope Process -Force function Get-GoogleImageSearchUrl

Calling a PowerShell script from Azure batch custom activity using PowerShell and application environment variable

怎甘沉沦 提交于 2021-02-20 03:01:12
问题 I've been slowly working out how to call a PowerShell script to transform IIS logs using LogParser 2.2. I've settled on using Azure Data Factory Batch Service Custom Activity to run the PowerShell script. I've been able to figure out how to address many of the file path issues that arise in running PowerShell from within Azure Custom Batch Activity, but I can't figure this one out. Currently I'm just trying to print via Write-Host the environment variable AZ_BATCH_APP_PACKAGE

Text Encoding between Linux and Windows

一世执手 提交于 2021-02-20 00:15:19
问题 The main question I have is how can I get a textfile that I have in Linux to display properly in PowerShell. In Linux, I have text files with some special characters, and in fact Notepad displays the text file exactly as it is displayed in Linux: Unfortunately, my program prints to my Linux Terminal, and thus I need the same output in my Windows terminal. I have seen through other answers that I need to use a TrueType font, so I am using Lucidia Console on my Linux device, the encoding is UTF

Text Encoding between Linux and Windows

拥有回忆 提交于 2021-02-20 00:14:54
问题 The main question I have is how can I get a textfile that I have in Linux to display properly in PowerShell. In Linux, I have text files with some special characters, and in fact Notepad displays the text file exactly as it is displayed in Linux: Unfortunately, my program prints to my Linux Terminal, and thus I need the same output in my Windows terminal. I have seen through other answers that I need to use a TrueType font, so I am using Lucidia Console on my Linux device, the encoding is UTF