Run powershell script without need to enter password
Stack Overflow » Powershell
by Bymemot
51m ago
I need to run some script using powershell on Windows Server 2016: & $ScriptPath\Setup-Server -ConfigPath $SystemConfigPath -Role Servak Once i run it, at some point i'm asking for the password twice which i need to enter manually (it's the same password). I want to avoid it and run the script using only command in powershell, without entering the password. I'm not concern about the security issues with that method. How can i do it? I need to type the password manually, which i want to avoid ..read more
Visit website
Windows 11 PowerShell Console appearance
Stack Overflow » Powershell
by Gordon
2h ago
In Windows 10 I was able to create a shortcut for running a PowerShell script and I could edit properties on that shortcut to manage the appearance of the console. I could set the font and font size, foreground and background colors (I need black text on a while background) and most importantly I could turn off output wrapping. With Windows 11 it seems like Microsoft has forced a new combined command line and console, with global settings that can't be managed on a case by case basis. Is that true, or am I missing the new way to do this ..read more
Visit website
Tee only STDERR in Powershell without red text
Stack Overflow » Powershell
by Enderbyte09
15h ago
I am using powershell to run this very annoying program that writes all of its progress output to STDERR. I want the output of this command to be both printed on to the console AND saved to a file. First, I used this: COMMAND | tee compile.log. Everything looked good on the console, but the log file was empty. So, I tried this: COMMAND 2>&1 | tee compile.log. This caused the log file to be written properly, but it caused huge issues: All output on the console was in the red error colour. No matter if the command was successful, the exit code is erroneous. So, is there something I can ..read more
Visit website
Powershell Core Get-Member
Stack Overflow » Powershell
by Roy Trotter
20h ago
Humbling seeking help. Beginner Powershell Core 7.4.2 scriptwriter. In reference to Get-Member results. My background is that I really prefer using Powershell Core's built in documentation rather than connecting to the internet or using an extension in an IDE. Here's an example of what I'm trying to do using just the Powershell Core Get-Member cmdlet. Example: Get-Member -Name Trim -InputObject system.string[] TypeName: System.String Name MemberType Definition ---- ---------- ---------- Trim Method string Trim(), string Trim(char trimChar), string Trim(Params char[] trimCha… My ques ..read more
Visit website
24/7 Powershell Script - Resource Management
Stack Overflow » Powershell
by Florian Dominikus
21h ago
I have a Powershell script that checks my network connection. If im connected to my domain - nothing happens. If im connected to a private network it starts my VPN app and establishes a connection. It its running hidden in the background. I want to adapt the script so that it checks my network status all the time and put it in my Startup because im a lazy ass swine. You could call it "Fake always on VPN". Now my question: Is it better for CPU usage and all resources to perform the request about the network status every one or two seconds or as a loop? Thanks in advance - greetings ..read more
Visit website
How to program powershell to wait for text to appear in webpage. Do-Until Loop?
Stack Overflow » Powershell
by Big Smooth
22h ago
Good afternoon. I am a novice programmer and Powershell user. I developed a very primitive hard coded program where I populate a form using simple commands like send Keys (enter, tab, up and down arrows )Etc. The form consist of 15 web pages where you hit the next button and the next page loads. Each page load time varies between 15 to 45 seconds depending on the UT1 environment traffic. After selecting the next button, I hard-coded sleep commands between 15 and 45 seconds giving enough time for the page to load. Is there a way I can make the flow and page loads more time efficient? I was thin ..read more
Visit website
Process started by Azure DevOps interactive environment agent ends when pipeline-job finishes
Stack Overflow » Powershell
by Matthias Schuchardt
22h ago
I want to deploy a long-running C#-executable to a Windows Server 2019 machine using Azure DevOps pipelines. The executable needs to run elevated and call an external application that cannot run in session 0. Thus the executable needs to run in an UI-session itself. I therefore use an interactive agent. Unfortunately the executable always closes whenever the pipeline-job finishes, but I need it to keep running. The behaviour is reproducible using the following pipeline. jobs: - deployment: environment: MyEnvironment.MyInteractiveAgent strategy: runOnce: deploy: steps ..read more
Visit website
Connection abruptly terminated by remote host when trying to gain ssh access a windows computer from outside the local network
Stack Overflow » Powershell
by Yes
1d ago
I have a windows computer and would like to gain ssh access to powershell from outside my home network. For this purpose, I opened a TCP port on my router and set up automatic forwarding to the computer I want to connect to. Then, I created a rule in my firewall: netsh advfirewall firewall add rule name="ps_ssh" dir=in action=allow protocol=TCP localport=<port_number> Then I installed and enabled ssh in a powershell admin window: Add-WindowsCapability -Online -Name OpenSSH.Server Start-Service sshd Set-Service -Name sshd -StartupType 'Automatic' Then I modified my %ProgramData ..read more
Visit website
Powershell with Graph API and PSCustomObject
Stack Overflow » Powershell
by thekevinkalis
1d ago
So all, I’m just looking for someone to help me across the finish line with a query. I’m using the Graph API to query assigned licenses to users from Microsoft Entra. So far, I can query a single user, and display the assigned licenses, but I’d like to output the information to a PSCustomObject, and that’s where I’m lost. This bit of code queries the directory and returns all users $GetUsersUrl = "https://graph.microsoft.com/beta/users" $Data = Invoke-RestMethod -Uri $GetUsersUrl -Headers $Headers -Method Get $Result = ($Data | select-object Value).Value $Users = $Result | select DisplayName ..read more
Visit website
Skip the first row in multiple CSV file
Stack Overflow » Powershell
by DAR
1d ago
Need to skip the first row in multiple CSV files. I am using the below Powershell code. But it is not giving the expected results. Get-ChildItem -Path $CSVFolder -Filter *.csv | %{ Import-Csv $_.FullName | Select -Skip 1 } | Export-Csv $_.FullName -NoTypeInformation ..read more
Visit website

Follow Stack Overflow » Powershell on FeedSpot

Continue with Google
Continue with Apple
OR