New answers tagged powershell
0
votes
How is the powershell $profile resolved?
For people in the future, it seems like I was able to change how my $profile was resolved (from the OneDrive location, to the original, classic, Microsoft-recommended Documents location by a ...
0
votes
Is PowerShell Test-Connection command from another PC cause loosing data between the wi-fi device and server
Is that command from CLIENT cause mis-communication of the DEVICE and SERVER?
The command opens a new TCP connection; it does nothing to test an existing connection.
So in theory it's possible for it ...
1
vote
Set-RDSessionCollectionConfiguration on powershell is complaining that no RDS service exists, even if it exists
Finaly the answer is:
The service user (which I use for winrm), must have added the terminal servers as manageable servers first to his Server-Manager!
How can this be? Server-Manager is a GUI tool ...
1
vote
How can I see the exit code of a program running in the PowerShell console
Daniel is right, the concept in Powershell is different and you may find further help in Powershell's documentation about how to handle Exceptions. This is what you like to use here. Check out $...
0
votes
Accepted
Applying Shell Launcher configuration via the official Powershell script fails
I have finally solved this problem, and it is due the atrocious and wrong Microsoft documentation. The script posted in the official docs is wrong. This works:
[string]$shellLauncherConfiguration = ...
0
votes
Registry Key PowerShell
So i answer my own question, only using [Microsoft.Win32.Registry] i was able to do this. Don't know, maybe there is other way. So function to test registry keys should work:
function RegistryKey-Test ...
0
votes
Registry Key PowerShell
HKEY_LocalMachine (or HKLM) requires administrative privileges to access.
Make sure you start Powershell (or PowerShell ISE if you're using that) as administrator before running the script.
1
vote
Accepted
How to send the harddisk password to an SATA HDD that is connected via a USB Adapter?
On a Linux operating system (I used Knoppix running from a USB-stick) I first opened the filemanager to look for the name, in my case 'sdb'. Then I opened the terminal and used
hdparm --security-...
0
votes
Run Powershell script when you open Powershell
I wanted to provide an expanded answer to the OP's question that includes a more robust, and decidedly more secure, solution to the problem where PowerShell, by default, will not execute PowerShell ...
0
votes
Microsoft ADK 10.1.26100.1, new Certificate, and Black Lotus
This command runs fine with /bootex in the command prompt.
It might throw error in powershell or Deployment and Imaging Tools Environment
0
votes
Is there anyway to see when a Windows firewall rule was created/enabled using PowerShell v2 or CMD?
Not exactly in-topic since we won't use PowerShell or CMD, but today I had a similar question, and found it is possible to quickly view last events in Windows Firewall with Advanced Security using ...
0
votes
Accepted
How to reload GPO Windows firewall after modification by Poweshell using e.g. New-NetFirewallRule or Set-NetFirewallRule
One way to reload the GPO firewall rules is (of course) to do a simple GPO update:
From the Windows console:
gpupdate /Target:Computer
Powershell:
Invoke-GPUpdate -Target "Computer"
Been ...
9
votes
How to send the harddisk password to an SATA HDD that is connected via a USB Adapter?
The USB-Device has to support some special command, and I saw a table that those JMicron devices support it.
That's generally for older JMicron devices. New USB-SATA adapters tend to support the ...
0
votes
How do I unzip zip archives and delete the files that I just unzipped at the same time?
I wrote a software with stream reader and decompressor, it delete file part as soon as it is extracted (whether it is volumes version or not). It should satisfy your and similiar requirements. See ...
0
votes
Get-Process in powershell doesn't show processes which are definitely running
Get-Process will list all running processes.
Searching for processes doesnt work how you think it does though. Get-Process does allow for easy searching by using wildcards. In your case, running Get-...
0
votes
"wsl --update" is apparently not a thing on my machine
I'm not absolutely certain what did it but I enabled Hyper-V on my machine [both in Windows and in BIOS generally enabled any and everything to do with Virtualization] and then restarted the PC (which ...
0
votes
How do I get line numbers with PowerShell?
Assuming we have a food.txt or create it with:
Set-Content food.txt "Apples`r`nBananas`r`nCarrots"
The verbose method would be:
Get-Content food.txt | Select-String . | Select-Object ...
0
votes
Accepted
Powershell IF loop not contiuning
$AccServiceName = 'AccountLoaderService'
$AccService = Get-Service $AccServiceName
if ($AccService.Status -eq 'Running') {
Write-Host '1'
Stop-Service $AccServiceName
}
Start-Sleep -Seconds ...
0
votes
PowerShell: trying to make file readonly made it disappear
It seems it can be recovered by adding -Force to Get-Item, and substracting the ReadOnly:
(Get-Item Nextcloud -Force).Attributes -= 'ReadOnly'
And the cause was adding a ReadOnly to an already ...
0
votes
Suppress PowerShell prompts when executing script from standard input
Here is my current hacky workaround using Invoke-Expression:
powershell -Command '$input | ForEach-Object { Invoke-Expression $_ }'
In action:
PS C:\path\to\script> Get-Content example.ps1 | ssh ...
0
votes
Looking to 'hide' a window by sending it to background or 'detatching' it from another window
Keep in mind that when you hide the window, the process will loose its window handle (turns to 0). The window handle is still a valid Id, but the Get-Process command will return 0 in the ...
0
votes
Accepted
Unable to delete duplicate guest user in exchange admin centre
Just wanted to let the folks here know, Microsoft had to be the one to delete the duplicate contacts on their back end, after multiple days of waiting, a systems engineer confirmed it was not ...
0
votes
Unable to delete duplicate guest user in exchange admin centre
I'm sorry to hear about the trouble you're experiencing with this guestmailuser issue. It sounds quite frustrating, especially after waiting for so long for a resolution from MSFT support.
In many ...
Top 50 recent answers are included
Related Tags
powershell × 6003windows × 1625
windows-10 × 868
command-line × 862
cmd.exe × 340
script × 324
windows-7 × 292
batch × 248
batch-file × 160
networking × 131
ssh × 118
windows-registry × 114
active-directory × 113
scheduled-tasks × 101
linux × 100
windows-11 × 97
bash × 92
windows-8 × 78
automation × 71
python × 70
csv × 70
shell-script × 67
group-policy × 66
powershell-5.0 × 66
permissions × 60