• Thanks for the code Adam, very helpful and nicely documented.

    0
  • Guys, please help me understand, when it comes to this command, how and where can I check and find out the type for IPaddress as it's mentioned here as System.Net.IPAddress 

    $new.RecordData.IPv4Address = [System.Net.IPAddress]::parse('192.168.0.254')

    0
  • News of the VMware license change has many vSphere administrators looking to audit their vSphere licensing. Using PowerCLI automation makes this much easier. Let's see how to perform the new VMware processor licensing audit with PowerShell.

    0
  • Hi there! Is it possible to get rid of the [PSCustomObject] thing for the $AccountInfo variable?

    I can't run this function as normal user because I get an error / runtime exception

    +       $AccountInfo = [PSCustomObject]@{
    +       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidArgument: (:) [], RuntimeException
        + FullyQualifiedErrorId : ConversionSupportedOnlyToCoreTypes

    0
  • hi

    how to download directories from Unix server to local system in binary mode.

    0
  • Microsoft is pushing people to VSCode.  There are apparently a lot of inherent limitations to the ISE.  

    But, thanks to some interesting experimentation by Adam Driscoll (Ironman software), you can make it work. https://ironmansoftware.com/using-powershell-core-6-and-7-in-the-windows-powershell-ise/

    David F. 

    0
  • One rather large let-down with the ISE is it has no straight forward 'intended' upgrade path; It appears that M$, in their immaculate stupidity, did not recognize that this tool should be upgraded with more modern versions of powershell, so they did not develop the app with this in mind, or at-the-least do not support it, as I can't find any documentation to do so in any case.

    0
  • 0
  • Paolo Maffezzoli posted an update in the group Group logo of PowerShellPowerShell 4 days, 1 hour ago

    Microsoft Releases Alpha Version of PowerShell Secrets Management Module - Petri
    Taking a look at the developer preview of a new PowerShell module from Microsoft that aims to make storing and securely accessing secrets easier in your PowerShell scripts.
    0
  • Are you on the inside or the outside? (i.e. calculating from the server itself, or from a workstation)

    You can just use the function I wrote out and use the extension as .*, and we can add a tracker to the function.. 

    function Get-FileSizeSum {
        [cmdletbinding()]
        param (
            [parameter(Mandatory, ValueFromPipelineByPropertyName)]
            [ValidateScript({Test-Path -path $_})]
            [string]$FilePath,
    
            [parameter(ValueFromPipelineByPropertyName)]
            [string]$Extension,
    
            [parameter(ValueFromPipelineByPropertyName)]
            [switch]$FilesOnly,
    
            [parameter(ValueFromPipelineByPropertyName)]
            [ValidateSet('KB', 'MB', 'GB', 'Byte')]
            [string]$SizeDisplay = 'MB,
    
            [parameter(ValueFromPipelineByPropertyName)]
            [switch]$Recurse
        )
        
        $Parameters = @{
            'FilePath' = $FilePath
            'Extension' = $Extension
        }
    
        if ($FilesOnly) {
            $null = $Parameters.Add('File', $null)
        }
    
        if ($Recurse) {
            $null = $Parameters.Add('Recurse', $null)
        }
    
        if ($Extension) {
            'Filter' = $Extension
        }
    
        $Files = Get-ChildItem @Parameters | Select-Object -Property Length
        $Files | ForEach-Object {
            $TotalSize  += $_.Length
        }
    
        if ($SizeDisplay -ne 'Byte') {
            $TotalSize = $TotalSize/$SizeDisplay
        }
    
        [pscustomobject]@{
            'Path'      = $FilePath
            'FileCount' = $Files.Count
            'TotalSize' = $TotalSize
        }
    }

    That adjusted version should get you what you are looking for.  Just feed in your list of paths, and that should get you the data 🙂

    David F.

    0
  • Hello,

    This is very helpful but and I am trying to adapt it to what I need but stuck.

    I need the run through a list of shares (UNC paths) and report the size of each share and how many files.  I need this for all folders and subfolders and files but I don't need a breakdown of the subfolders and files.  I do not need hidden files.

    So for example, these 3 shares.  I need import a csv list of shares / paths.

    Server1UserShare1Bob

    Server2UserShare2John

    Server3UserShare3Amy

     

    thanks!

    0
  • Is the date on the website? Then use Invoke-WebRequest to read and then adapt the script to get the right URL of the zip. Will take some coding.

    0
  • Hi Michael

    i am downloading a  zip file from a website using the PowerShell, however the issue  is that i have to filter by date to download that zip file.

    Thank you.

    0
  • I am trying to create the APEX record for my local AD DNS based on the IP I get back from AWS(Cloudfront)

    Where I am having trouble is the value or lack of value for the @.

    In AD DNS, the record name is simply left blank. Works great, I have not found a similar method to create a record in powershell to create this type of DNS entry.

    0
  • Why is there no measure for total call count

     

    0
  • Paolo Maffezzoli posted an update in the group Group logo of PowerShellPowerShell 1 week, 3 days ago

    Public Preview of PowerShell Support in Jupyter Notebooks | PowerShell
    Public Preview of PowerShell Support in Jupyter NotebooksToday, the .NET team shipped an exciting new preview of .NET Interactive. If youre unfamiliar, .NET Interactive (within a Jupyter environment) provides the ability to write .NET Jupyter Notebooks which are a powerful tool that combines documentation and the ability to execute and see the output of code all in the same file.
    0
  • Paolo Maffezzoli posted an update in the group Group logo of PowerShellPowerShell 1 week, 6 days ago

    Secrets Management Module Vault Extensions | PowerShell
    Secrets Management Module Vault ExtensionsA new PowerShell Secrets Management module has been published on PowerShell Gallery. It is currently in a pre-release state and still in active development. Even though the module is not complete, we have released it to gather early community feedback.
    0
  • @Larry Wakeman,

    All you have to do is filter your Get-ChildItem, grab the length, and sum it up..

    Get-ChildItem -path  -recurse -file -filter *.msp | foreach-object {
    $TotalLength  = $_.Length
    }
    $TotalLength
    $TotalLength/1MB
    $TotalLength/1GB

    You can shorten it up and remove the -file and the -filter

    Get-ChildItem -Path .*.psm1 -recurse | ForEach-Object { $TotalLength  = $_.length }

    or.. we can go overboard and turn it into a full blown function..

    function Get-FileSizeSum {
        [cmdletbinding()]
        param (
            [parameter(Mandatory, ValueFromPipelineByPropertyName)]
            [ValidateScript({Test-Path -path $_})]
            [string]$FilePath,
    
            [parameter(Mandatory, ValueFromPipelineByPropertyName)]
            [string]$Extension = '.msp',
    
            [parameter(ValueFromPipelineByPropertyName)]
            [ValidateSet('KB', 'MB', 'GB', 'Byte')]
            [string]$SizeDisplay = 'MB,
    
            [parameter(ValueFromPipelineByPropertyName)]
            [switch]$Recurse
        )
        
        $Parameters = @{
            'FilePath' = $FilePath
            'Extension' = $Extension
        }
    
        if ($Recurse) {
            $null = $Parameters.Add('Recurse', $null)
        }
        Get-ChildItem @Parameters | ForEach-Object {
            $TotalSize  = $_.Length
        }
    
        if ($SizeDisplay -eq 'Byte') {
            $TotalSize
        }
        else {
            $TotalSize/$SizeDisplay
        }
    }

    I'm showing all kinds of things you *can* do.. 

    David F. 

    0
  • Hello,

    Thank you very much for the article.

    I have one question in case you are aware of this issue.

     In the forest we have 4 x 2016 DCs,  2x 2012 R2 DCs and 3x 2008R2 DCs (The FFL & DFL are Windows Server 2008 R2).Can a 2016 RODC be used/installed?

    0
  • Hi, I just started using PowerShell today (though I'm a seasoned programmer).  What I'm trying to do is sum file sizes for specific file types, like *.msp.  Thanks!

    0
  • Load More