Tagged Questions
PowerShell is a command line and scripting utility for use with Windows. PowerShell questions are for writing and executing scripts ONLY. Questions about administrating Windows should be asked on https://superuser.com.
1
vote
1answer
23 views
Power Shell : What is the most efficient way to use variable / string builder with memory?
I'm trying to learn efficiency in programming/scripting and I know stuff happens in the background that I may not be aware of.
$sb = new-object System.text.stringbuilder;
$sb.append("Hello World");
...
0
votes
1answer
18 views
powershell double for loop
Need advice on loop
$Variable contains 11111 22222
foreach ($variable in $value) {
for ([byte]$c = [char]'b'; $c -le [char]'c'; $c++) {
$variable."([char]$c)" } }
...
1
vote
1answer
17 views
Get description of second OU/CN
I have following script:
Get-ADUser -Filter {SamAccountName -like "z*"} -Properties * | select samaccountname, name, Email
Address, @{Name="LastLogonTimeStamp";Expression={([datetime]::FromFileTime($...
1
vote
1answer
21 views
launch powershell and commands at once
if I do this in a powershell:
echo beep ; echo beep
it prints:
beep
beep
but if I do this in a regular console:
powershell -command { echo beep ; echo beep }
it prints:
echo beep ; echo beep
...
0
votes
1answer
20 views
how can I get to <li> nested inside <ul> nested inside multiple <div> tags in powershell
Here is the HTML code that I want to take info from
<div id="container">
<div id="classifiedDetail">
<div class="classifiedDetail">
<div class="...
1
vote
0answers
19 views
Hidden PS window via VBS with return code
I am trying to use a VBScript helper script to launch a PowerShell script in a hidden window. I have been doing this successfully for some time, but now I want to add getting a return code, and that ...
0
votes
0answers
10 views
Powershell connection from specific local IP Address
I have a local computer with multiple ip addresses:
192.168.1.1 <-- I want to use this ip
192.168.1.2
From the local computer I want to start a PowerShell session to a remote server:
192.168.1.12
...
1
vote
0answers
23 views
Why is gcc interpreting this as single option only?
I'm trying to compile a gtk program on PowerShell so that I can use pkg-config's output as input to gcc but gcc is taking the whole output as a single command line option and return the error:
gcc....
-1
votes
0answers
8 views
Right click command “Run with PowerShell” for any .ps1 file is not working
I was making a .ps1 file with some commands I want to run. Everting went perfect, but when I tried to run the file by right click on it and select "Run with PowerShell" I discovered a very strange ...
1
vote
1answer
19 views
powershell command to enable/disable logitech unifying dongle
I'm trying to run the following powershell command as administrator to arbitrarily enable and disable the Logictech dongle for my keyboard and mouse. Here's what I'm trying to do:
PS C:\> Get-...
0
votes
0answers
13 views
Invoke-WebRequest and Hebrew characters
I already tried the reghack for PS to support Hebrew characters. I can type Hebrew no problems but for some reasons characters containing Hebrew returned from Invoke-WebRequest are in gibberish (see ...
0
votes
3answers
22 views
Powershell: How can I create text files within folders recursively?
I'm new to Powershell and I have searched for a way to recursively create text files within newly created folders but the code I have so far is not creating the text file in the appropriate folder but ...
1
vote
0answers
19 views
I can not run SkypeOnline PowerShell script in c# program
I am trying to run this SkypeOnline script in program on C#.
And have exception.
Script works well in PowerShell command line.
using (var powerShellInstance = PowerShell.Create())
{
...
0
votes
0answers
11 views
Running powershell script in Webjob
I am running below powershell script in Azure Webjob to conenct to Storage account and upload a file
Write-Output "Getting Azure storage context..."
$storageContext = New-AzureStorageContext -...
-1
votes
0answers
32 views
How to programmatically set properties/metadata for music on Windows? [on hold]
I have some music (e.g. mp3 files) in Windows folders. I'd like to be able to write a batch file or something to change some of the properties. For example, I might want to change the Genre of every ...