How do I write a value to an OPC tag in kepware using PowerShell
How do I write/update the value of tag2 in Kepware using PowerShell. This is my code example and I am getting the errorInvoke-RestMethod : The remote server returned an error: (400) Bad Request.At...
View ArticleIs there a way to check if the script is running by PowerShell ISE?
I want to skip the Start-Transcript and Stop-Transcript lines if the PowerShell script is running by PowerShell ISE.Is this possible? And how can I achieve this?
View ArticleAPI returning response as 3 instead of json when we copy request from "copy...
when i tried to copy request objects from chrome browser by "Copy as PowerShell" option , and try to paste that into PowerShell in my machine.i am getting content in response as 3 ,instead of json...
View ArticleEnter-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 ArticleReplace-Files Powershell
I'm having some struggles with my PowerShell script. I am trying to make an Automated Script that will Perform the Utilman.exe Hack. The script has menus and options: Load, Unload, List Disk and Create...
View ArticleHow to remove property header from output when runnign Get-ADComputer
I want to pull the names of computer objects in AD in to a file. The method I'm trying so far is this$computers = Get-ADComputer -Filter * | Format-List namewrite($computers) | Out-File -FilePath...
View ArticleHow to properly export XML to file using Powershell
Importing any valid XML file as source using [XML]$Var = Get-Content -Path $PathToAnyValidXML I am unable to export it's content properly. Using Set-Content SomePath $Var , the file ends with...
View ArticleEasier way to parse 'query user' in PowerShell (or quser)
I currently have the following query in PowerShell:query user /server:$serverWhich returns output:USERNAME SESSIONNAME ID STATE IDLE TIME LOGON TIME svc_chthost 2 Disc 1:05 8/16/2016 12:01 PM...
View ArticleSuppressing VERBOSE for Import-Module
I'm importing Carbon into my PowerShell script; however when running my script with -Verbose, Carbon also outputs a lot of VERBOSE statements.Is it possible to Import-Module silently such that I can...
View ArticleSetup default date format like yyyy-mm-dd in Powershell?
A simple & short question:How can I setup a default date format in powershell like yyyy-mm-dd ? so any date output will be like this format?or How to setup a date format globally in one script ?Is...
View Articleexporting from powershell to txt file
I'm trying to set up a scope on dhcp via powershell and export info to txt file. My code does what it needs to do, but when i export to txtfile with | out file it only exports the reserved ip not the...
View ArticleHow to truly automate a powershell script without scheduler
My script basically runs on specific times during a day. Accesses the server and downloads data. So far I have tried playing around with start-sleep command and timespan command but I am new to...
View ArticlePowerShell 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 ArticlePowershell: 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