Quantcast
Channel: Active questions tagged powershell-3.0 - Stack Overflow
Browsing index pages (152 articles)
↧

Running a script on a virtual machine using Invoke-Command

I wrote this code:$vmName = $args[0]$sign_check_tool = $args[1]$arguments = $args[2]$remote_session = New-PSSession -VMName $vmName -Credential $credtry {Invoke-Command -Session $remote_session -Block...

View Article


Start-Process Filepath with Variable in Button.add_click won't work as expected

Second question today but this time I believe there's something really strange going on. The following code is not my original, I tried to reproduce the behavior with as few lines as possible. In my...

View Article


Powershell - rename folder in C:\Windows\

I need some help. I need to rename a few folder in c:\Windows\ but it keeps saying that access is denied. I'm running poweshell as admin.Rename-Item -path 'C:\Windows\SoftwareDistribution' -NewName...

View Article

Enter-Pssession not working

I have to machines in same network one with windows7 and another win windows server 2012.I tried Enter-PSsession on windows7 machine from server2012 machine... $ComputerName = "windows7-PC"...

View Article

how to get IP address of all virtual machines running on hyper V

is there any way to get IP addresses of all running Virtual machines with PowerShell? I have tried the followingGet-VM | ?{$_.State -eq "Running"} | Select -ExpandProperty networkadaptersGet-VM |...

View Article


Get error when doing Enter-PSSession - Connecting to remote server failed

I'm trying to remote on to another computer (an aws workspace) and using: Enter-PSSession -ComputerName [IP-ADDRESS] -Credential $credBut get error:Enter-PSSession : Connecting to remote server...

View Article

PowerShell flattening nested JSON and convert it to CSV

I have a JSON file below. I am trying to flatten and convert it to CSV. {"tempid": "template_86CE6E3BE3AD4EAB95727BCBFAD6A83C","auid": "audit_00006F5D7A114CE59AD572E3E878E726","created_at":...

View Article

Difference between PSObject, Hashtable, and PSCustomObject

Can anybody explain the details? If I create an object using$var = [PSObject]@{a=1;b=2;c=3}and then I look for its type using getType() PowerShell tells me it's of type Hashtable.When using Get-Member...

View Article


Tracing where output is coming from in a Powershell script

Is it possible to trace where output (to the console) is coming from in a Powershell script? I've got a script which is outputting information to me but I'm not sure which line is making the output. Is...

View Article


Verify Robocopy Operation [closed]

I want to run a scheduled script after running a Robocopy Script, which moves files between remote servers.The requirement of this script is that, it will check whether the Robocopy script has...

View Article

Trying to run Get-WindowsUpdate on a remote computer but get: Access is...

I've got a powershell script to remote into other computers to get and install windows updates.I'm logged into the admin account on my local machine. The script starts a powershell remote session into...

View Article

Windows Powershell shortcut to delete previous command's output

In the macOS terminal application (Terminal.app), there is a shortcut (cmd+l) to delete the previous command's output. Is there such a shortcut in Powershell?

View Article

Powershell: Set a Scheduled Task to run when user isn't logged in

I have been using the Powershell Scheduled Task Cmdlets to create a scheduled task on our servers.How do I elect to 'Run whether a user is logged in or not using this API?I've created action, trigger,...

View Article


Get value from JSON using string from array [duplicate]

What I'm trying to do is getting one specific value from nested JSON. Using array keys as expression.Array with keys and values: $AccountService = @{'root.branch.setting1'=...

View Article

Automate process of Disk Cleanup cleanmgr.exe without user intervention

I am developing a powershell script file which shall execute some disk cleanup without user intervention. The user shall not be able to configure anything.When I run cleanmgr.exe /d c: sageset:1 a...

View Article


List of all colors available for PowerShell?

I am searching for a list of all colors I can use in PowerShell. Since we need to provide names and no hexnumbers, it's hard to figure out if a color exists or not, at least if you don't know how...

View Article

Restore multiple analysis databases from Windows explorer with Powershell

I am trying to maken a PS script that retores multiple analysis databases to SSAS from Windows explorer.Here are the databases F:\\Backup\\SSAS\\SQL002\\, xx.abf and yy.abf and many more.This is the...

View Article


How can I extract "Path to executable" of all services with PowerShell

Get-Service *sql* | sort DisplayName | out-file c:/servicelist.txtI have a one line PowerShell script to extract list of all services running on my local machine, now, in addition to displaying...

View Article

Powershell: Scheduled Task with Daily Trigger and Repetition Interval

I cant seem to figure out how to create a new scheduled task that is triggered daily and repeats every 30 minutes. I have been going in circles.Everything about this below works for setting the task I...

View Article

PowerShell 3: Every Command Execution Results In "The type initializer [...]...

DescriptionI've installed the new PowerShell version on my system a few months ago. Since that, something strange happens every time I use the shell. It doesn't trouble the functionality, but it's...

View Article
Browsing index pages (152 articles)


Latest Images