119,176 questions
0
votes
0
answers
171
views
System.Dynamic.DynamicObject TryGetMember not working in Powershell [closed]
edit
shame on me! the problem was a typo I did not see. I promise to be more careful proof reading my code next time.
Following this answer to my question "get or set nonexistent properties of ...
-4
votes
0
answers
57
views
cmd.exe automatically respawns with random arguments and consumes 4+ GB RAM on Windows 11 [closed]
Symptoms:
cmd.exe appears automatically even after killing it.
Sometimes there are two instances.
RAM usage grows until the system becomes nearly unusable.
The process disappears and comes back ...
0
votes
0
answers
37
views
Sporadic failure of PowerShell runs after update to 4.268.0 "An error occurred while creating the pipeline"
We updated our agents from 3.238 to 4.268 mid february. Exactly one week later, multiple pipelines started receiving the following error:
========================== Starting Command Output ============...
Advice
2
votes
11
replies
221
views
get or set nonexistent properties of Powershell object
In Powershell, if I create a Hashtable I can get/set values via pseudo properties
$h = @{ }
$h.a
# returns $null
# add a key/value with key 'a'
$h.a = 'abc'
$h.a
# returns 'abc'
This is not limited ...
3
votes
3
answers
118
views
Disable all links for a specific GPO
I need to disable all Links for a specific GPO using PowerShell.
I know the simple command would be
Set-GPLink -Name $gpoName -Target $targetPath -LinkEnabled No
and that would work if I wanted to do ...
-2
votes
0
answers
61
views
Do Azure runbooks have SQL Server TDS access?
I am trying to run SQL queries against an Azure managed instance from a Powershell script in an Azure automation account runbook. And I'm getting an "unable to connect" error that looks like ...
0
votes
0
answers
87
views
How to get task scheduler to run in the early hours? [migrated]
I've built a Windows task that I want to run in the hours between midnight and 6 AM. It has not yet run in those hours. On occasion it will run at later hours, but not always. The scheduled powershell ...
-4
votes
0
answers
55
views
How do I Pass a Password Variable with NET USE Command in Powershell [duplicate]
I am unable to have a password variable in net use command to work however if I a use a plain text password it works.
What changes do I need to make. Any help would be much appreciated.
#Authenitcate ...
4
votes
2
answers
190
views
get-childitem and folder structures with folder names containing '&'
Have this basic excerpt of a directory structure with folder name containing an &.
Music
- Massive_Attack
- Collected
- Mezzanine
- Protection
- ...
Advice
2
votes
0
replies
68
views
LNK File and Jump Lists
Context/Goal
I am currently finalizing a paper on Windows Shell artifact generation and wanted to share some experimental findings regarding the interaction between applications and `shell32.dll`. My ...
Best practices
0
votes
2
replies
118
views
For use by ServerFault scripters at shell - any OS "default top" names
What is the right list of characters for default, top at sorts of operating system as prefix?
AAAA
1111
Variation or different. As in DOS, a structure for files and operations at "most important ...
2
votes
1
answer
99
views
Why does a string of my machine name vs [Environment]::MachineName.ToString() produce different outputs in my function?
Why do I have two different output values when I pass a string of my machine name vs using [Environment]::MachineName.ToString()? Somehow the SHA256 sees them differently and I need them to be seen ...
1
vote
1
answer
120
views
Powershell error: The expression after '&' in a pipeline element produced an object that was not valid
I have a script I have created that throws the following error:
The expression after '&' in a pipeline element produced an object that was not valid. It must result in a command name, a script ...
-2
votes
1
answer
170
views
Ghosted highlighting in vs code powershell terminal
Look at the images. After the first word of any command, anything written after that is getting highlighted with a grey background (depends on the theme though and it looks worst on lighter themes as ...
2
votes
0
answers
109
views
Find the same not-installed Windows updates as the UI with PowerShell
Here is what Windows Settings shows me:
I try to get the same list using PowerShell. Here is my script
$session = New-Object -ComObject 'Microsoft.Update.Session';
$searcher = $session....