The workflow definition has been recycled, because the workflow definition...
Hi all,We are experiencing a issue executing a long powershell processes. We get this message:The workflow definition has been recycled, because the workflow definition cache limit of 1000 has...
View ArticleNew-NetIPAddress : Invalid parameter InterfaceAlias
hello,I am trying to configure an IP address for a VM. My version of PS is 5-1-17134-407I issued New-NetIPAddress -IPAddress 10.2.0.1 -PrefixLength 24 -InterfaceAlias "vEthernet_Lab_Switch"as well as...
View ArticleHow to display the contents of an array
Hi!I have an array with two objects in it:$i = "ServerA" $RC = 1030 $Array_object = New-Object System.Object $Array = @() $Array_object | Add-Member -type NoteProperty -Name Instance -Value $i...
View ArticleHow to determine permission to run certain cmdlet
Hello there,I have a PS-Script with the following content, which I want to trigger as scheduled task:Import-Module SMLets $class = Get-SCSMClass | where{$_.name -match “system.configitem”}...
View ArticleHow to have an incrementing Array Object Name
Hi!I want to add an object to an array withing a loop. Can anyone tell me how to increment the name of the object?i.e n the following code I the first time it runs I want it to create an object called...
View ArticleCut does not remove text from the script pane - PowerShell 5.1 ISE Desktop -...
When I try to cut text in the script pane using either Ctrl+x, Edit>Cut, or the Cut icon in the tool bar the text is not removed from the script pane. It behaves the same as Copy - copies the text...
View ArticleHow do I find
HelloThis is the 1st time using power shell. I have managed to use it to restrict the time and day a generic account can logon. The issue is more for my own interest is where does power-shell save it...
View ArticleSharepoint online audit
HI,When I try to retrieve the Sharepointonline audit data using search-unifiedauditlog .For an particular site it seems to be getting onlypageview where as other events are not able to be fetched Even...
View ArticleEditing code to show hostname
Hi All.I have this great piece of code which gives me IP addresses of host names, because some of the hostnames are not on the network, I would like to append the hostname and the IP address in my...
View ArticleHow can I make the powershell ISE work like the package manager in visual...
I would like to learn how to build this example without using visual studio:https://www.infoworld.com/article/3192900/c-sharp/how-to-work-with-automapper-in-c.htmlWhen I fire up the powershell ISE and...
View Article-password never expires
Hi everyone,i have to add users by using these commands:With that i want the password never to expire by using PS commands how do i do that i have tried alot of things#New-Item -Path...
View ArticleFor each loop to find users manager
I'm trying to get a list of users that are managed by a few managers. This for each loop only sees first name in the text file and does not loop to the second line of the text file. Does anyone have...
View ArticleDISM Path failure
I'm trying to run a powershell script for a study course I have, however each time I get the below failure.Import-Module : Cannot bind argument to parameter 'Name' because it is null.At C:\Program...
View ArticlePowerShell to list Java version on remote computers
I've been trying to put together a script but my Powershell skillls are not up to par. This touches on it...
View ArticleDifference between declaring array with @{} and @()
I've seen countless tutorials show that arrays are declared in such a fashion: $myArray = @("Hello","World")I know that hashtables can be created by using the brackets as follows:$myHashTable = @{key1...
View Articleproblem with $_.
Hi,I have just started with powershell and programming. I am experimenting with Functions a bit. I would like to get al the files that have not been used or written to for a while.I have writen the...
View ArticleUsing variable with Get-itemproperty
When I use variable to take list of "Uninstall" registry's subkeys, I am getting en error as given below.get-Itemproperty : Cannot find path...
View ArticleNew-SelfSignedCertificate
Hi,while trying to use New-SelfSignedCertificate I get an error saying the cmdlet is not found on one Windows 10 1803 system but it works on another. Is there some package that I have to install to get...
View ArticleChange date + time in file
Hi, I am very new in powershell, I hope someone will help me:I have a file in C:\tmp\appFiles.appcacheWhich contains: CACHE MANIFEST # Version: 2019-01-04T00:48:08.3070330+01:00 # Use from network if...
View ArticleUnable to do Format-Volume with NTFS
Trying to do a script to ease up the need for formatting a lot of USBsHow ever i had the script working fine for like 1 or 2 times. Haven't been able to do get the command working again.Format-Volume...
View Article