Loading...

Follow Reddit - PowerShell on Feedspot


Valid
or
Continue with Google
Continue with Facebook
Read Full Article
Visit website
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

So this may sound weird but my girlfriend wants to get a tattoo and she likes the idea of powershell being on her body forever - I work in IT and she wants something that is a big part of my life to be on her. Plus she liked the color-formatting on atom. So who am I to object! The only thing is that powershell isn't exactly a romance language ...

So I have been racking my brain for something short, sweet, heartfelt, and cute.

Can anyone help me think of some things that aren't too cheeseball but maybe have some good hidden love meaning to them?

She is itching to get this done, so I can promise at least a followup with the work done within a short amount of time. Though I am not sure where she will get it done ... possibly her side I would guess so maybe we all get some powershell side-boob!

Edit:

I didn’t realize how toxic and absolutely horrible miserable assholes some of you could be. I genuinely feel sorry for you and I hope you find some kind of happiness in your lives.

submitted by /u/relationshart
[visit reddit] [comments]
Read Full Article
Visit website
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

I have just been reading about how to download modules from PSGallery from within Powershell

https://i.redd.it/gnkx38out6011.png

  1. Is this controlled by Microsoft or a third party?
  2. Are module checked to make sure they are safe?
submitted by /u/AussieSysadmin
[visit reddit] [comments]
Read Full Article
Visit website
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

I'm not looking for anyone to do the actual work for me. I'm just checking the feasability of creating a PowerShell app with Sapien PS Studio that will allow me to make new list items, edit current list items inside a powershell app.

Is this even possible?

submitted by /u/datkappa__1
[visit reddit] [comments]
Read Full Article
Visit website
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

Hey All,

I'm creating a script for practice and had some issues near the end. I'm creating this script to ask for information and create a VM on a remote hyper v server with sed information. However at the end when it attempts to create the VM it has an error saying:

Invoke-Command : A positional parameter cannot be found that accepts argument 'vm01'. At E:\Misc\PowerShell-Script-Temp\RemoteHV-VM-Creation.ps1:47 char:1

What could be causing that? I've been tearing my hair out trying to find the answer.

Here's the code below:

This is to remotely create VMs via powershell CLI This can be used to remotely create vms in other Hyper-V hosts and can be linked / changed to other scripts to automate the deployment of VMs

clear

This asks for the VM host you want to create the vm on
$HVRemoteHost = Read-Host -Prompt 'What system do you want to create VMs on?' 
VM name variable taken from the input
$VMName = Read-Host -Prompt 'What do you want the name to be?' 
Asking for VM memory variable
$VMMemory = Read-Host -Prompt 'How much Memory should the vm have?(example: 4GB )' 
Asking for VM memory variable
$VMVHDX = Read-Host -Prompt 'How large will the VHDX be?' 
Listing remote hosts virtual networks

$InvokeVMNICs = Invoke-Command -ComputerName $HVRemoteHost -ScriptBlock {

Get-VMSwitch -SwitchType External | Sort-Object Name

} #This will then print out what was above ^ Write-Host $InvokeVMNICs

#Asking what VMNIC you'd like to add $VMNIC = Read-Host -Prompt 'What network would you like the VM to be a part of?' 
This will list the disks

Invoke-Command -ComputerName $HVRemoteHost -ScriptBlock {

Get-PSDrive

}

#Asking the for the VM location after listing the disks on the remote host machines $VMlocation = Read-Host -Prompt 'Where do you want to store this VM' 
This is to invoke the command on the remote machine

Invoke-Command -ComputerName $HVRemoteHost -ScriptBlock {

This will create the vm on the remote machine

New-VM -Name $VMName -MemoryStartupBytes $VMMemory -BootDevice VHDX -NewVHDPath $VMLocation\$VMName.vhdx -Path $VMLocation -NewVHDSizeBytes $VMVHDX -Generation 2 -Switch $VMNIC

 #This allows the passing through of the variables 

} -ArgumentList $HVRemoteHost $VMName $VMMemory $InvokeVMNICs $VMNIC $VMlocation $VMVHDX

Then the VM will start

Start-VM -Name $VMName

Connect-VM $VMName

submitted by /u/zveroboy152
[visit reddit] [comments]
Read Full Article
Visit website
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

I'm trying to run the following command with a script powershell executionpolicy bypass -File .\grantaccesscode.ps1.

Unfortunately the command gives me errors as Powershell was run as an administrator and therefore the sub path to which the script is trying to access is only available as a standard user.

How can I run the command as an Administrator as required by powershell to execute a elevated commands but when running the command have it search not within an Administrator account; rather a standard account for the sub-path ?

submitted by /u/SonicSkunk
[visit reddit] [comments]
Read Full Article
Visit website
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

For example:

if I throw the certs in my cert store into a variable: $z=Get-ChildItem -Path CERT:\LocalMachine\My

I can then enumerate the friendlynames with a: $z.friendlyname

But if I do the same remotely:

$z=invoke-command -session $sess -scriptblock {Get-ChildItem -Path CERT:\LocalMachine\My}

I still get an array of objects with thumbprint, Subject, etc but no friendlyname.

What's up with that?

submitted by /u/tadc
[visit reddit] [comments]
Read Full Article
Visit website
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

Whenever I run a script to reset user passwords in AD it works great. When I run powershell I type reset-userpwd, and then i am asked to type in part or all of the users last name. After I type in the last name (or part of the last name) I choose from a list of users that meet the criteria and the password is automatically reset. However there is a weird instance when say I'm resetting the user with last name "Babb" and they are the only Babb in AD I am given the error "Babb: the term 'babb' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 +Babb + ~~~~ + Category info :object not found: (Babb: string) [], commandnotfoundexpection +FullyqualifiederrorID : commandfoundexception

However if I just type in "ba" it will bring up a list of all users with ba in their last name.

I hope I explained this well.

submitted by /u/escapednut
[visit reddit] [comments]
Read Full Article
Visit website
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

To start this question off, i'm making a test script which adds each VPN connection I have to my connection address book. This might be something extremely simple but so far what I've done just to run the cmdlet once is:

$params = @{'Name' = 'VPN-Name'; 'ServerAddress' = '127.0.0.1'; 'TunnelType' = 'L2TP'; 'EncryptionLevel' = 'Optional'; 'AuthenticationMethod' = 'Pap'; 'L2tpPsk' = 'presharedkey'; }

Add-VpnConnection @params -Force

So let's say I have a collection of VPN's, what would be the best way to looping through the add-vpnconnection cmdlet and having new params for each time it looks?

Thank you for any of your help it's greatly appreciated!

submitted by /u/bloonacho
[visit reddit] [comments]
Read Full Article
Visit website

Read for later

Articles marked as Favorite are saved for later viewing.
close
  • Show original
  • .
  • Share
  • .
  • Favorite
  • .
  • Email
  • .
  • Add Tags 

Separate tags by commas
To access this feature, please upgrade your account.
Start your free month
Free Preview