Quantcast
Channel: VMware Communities : Discussion List - VMware PowerCLI
Viewing all 14549 articles
Browse latest View live

Schedule Snapshot with PowerCli

$
0
0

Hi All,

 

I there any way to use PowerCli to schedule a snapshot? I'm looking to built a script to take user inputs such as Vm name, snapshot name, snapshot date, etc. to schedule a snapshot. I'm hoping to create a simple webpage to take some user inputs and pass it to script. I saw some examples that use PowerShell to create schedule task but they are all about creating a windows scheduled task. I would like to create the task as you would create in vSphere.

 

Thanks,

Haluk


Update-VsanHclDatabase

$
0
0

Hi

I'm trying to run an Update-VsanHclDatabase, but I get an error "The object reference does not point to an instance of the object"

Need script to enable "Check and upgradetools during power cycling" on all VMs

$
0
0

What is the best method for enabling this option on all VMs? Is there a good way to do it without either editing the VMX files on every machine or doing it manually though edit settings?

Attach-Baseline / Detach-Baseline - 5.5 VCENTER

$
0
0

I am having a brain lapse today on this simple script.  I am sure I am doing something incorrect here.

All I am trying to do is attach a new Update Manager Baseline to my 5.5 VCENTER

 

Attach-Baseline -Entity 'xxxx'

 

not sure what do I put if I want to attach the baseline to the top level of the VCENTER.  not a cluster or host.

Getting information about number of vCPU, sockets, shares, ...

$
0
0

I need to get a list off all the VMs in a given vSphere infrastructure and to get, for each vm, the number of vCPUs, the number of sockets, the number of cores, the CPU share level and number.

I need to get each value as a variable because I need to format the output according to a standard format.

I was able to create a script to get part of the information I need by copying from various forums and blogs but I am sure I made some mistakes, as for each VM it takes about 60 seconds and it is unusable.

Is there any efficient, optimized sample I can start from?

Regards

marius

PowerCLI script for gathering data metrics for $fullname, please help!

$
0
0

@Not sure where I found this script but it is quite amazing! I would like to modify this script to get all of the available metrics and values for each of the $fullname variables. I am new to PowerCLI and the terminology but the output of this script shows all variables, the levels and the definition as it states in the script memos. I need to gather all of the vmhost averages and values. I would love to be able to configure the script to also show the values in %'s / gb / ms etc etc. Please help? I know the output currently generates an error, I am unable to get the values from the fullnames.

# define where we will save our performance metrics.   

Import Lists of VMs with Different Column Titles

$
0
0

I need to run scripts against multiple csv input files and get lists of VMs.  However I'm running an issue.  My script is like this:

 

$path = "c:\inputfile.csv"

Import-Csv -Path $path -UseCulture | foreach{

$vmname = $_.vmname

get-vm $vmname}

 

However the problem is that the input files have multiple different column names for VMname. Some input files have VMname, some have Systemname, hostname, servername, server or VM as the column title for the VM name.

 

How can I modify my script so that I assign the $vmname to whichever of these column titles is used?

 

Thanks!

Snapshot report

$
0
0

Hi,

I have few methods to report some snapshots from my enviroment:

First method:

Get-VM | %{$vm = $_.Name ; $_ | Get-Snapshot | Where { $_.Name -like "auto-*"} | Measure-Object | %{write-host $vm $_.Count}}

VM Name      Snapshots with "auto" in name

VM1                                 2

VM2                                1

With this method I can get what I want: VM name and number of snapshots with "auto" word found in name but exporting to HTML only generate a blank file

Second method:

$ss = Get-vm | Get-Snapshot
#$ss | Select-Object vm, name, description, powerstate | ConvertTo-HTML -head $a -body "<H2>VM Snapshot Report</H2>"| Out-File $filename
$ss | Select-Object vm, name, description | ConvertTo-HTML -head $a -body "<H2>VM Snapshot Report</H2>"| Out-File $filename

$ss = Get-vm | Get-Snapshot

 

#$ss | Select-Object vm, name, description, powerstate | ConvertTo-HTML -head $a -body "<H2>VM Snapshot Report</H2>"| Out-File $filename

 

 

$ss | Select-Object vm, name, description | ConvertTo-HTML -head $a -body "<H2>VM Snapshot Report</H2>"| Out-File $filename

VM Name          Snapshot name

VM1                    snapshot1

VM1                   snapshot2

 

VM2                  snapshot2

VM2                 snapshot3

 

This method is working but I'm able to get only VM name on one column and each snapshot with name from each VM.

 

I've already tried all kind of tricks to generate a report with VM name on one column and number of snapshots with "auto" in name but none of this are working.


Decreasing number of CPUs on multiple VMs

$
0
0

Hello,

 

We have many VMs with over provisioned CPUs, need to remove 1 CPU from them.

Appreciate any help.

 

Thank you in advance!

Inject a .VIB into a ESXi .ISO using ESXi-Customizer-PS

$
0
0

Hello.

I tried to install "Vmware-ESXi-6.0.0-7967664-Custom-Cisco-6.0.3.4.iso" on a server.
This is not a Cisco server but I was told I could install this ISO on this server.

Unfortunately, the network adapter was not detected at installation.

esxi_install_no_nics.png

The netword adapter on the server is:

Qualcomm Atheros AR8161 Gigabit Ethernet

PCI id: 1969:1091

 

I also downloaded a .VIB file for this network adapter:

"VMWareVIBPack\AtherosAR8161vib\net-alx-2.0.0.6b.x86_64.vib"

 

I wanted to inject the VIB into the ISO to get a new ISO.

 

I installed "VMware PowerCLI" and downloaded "ESXi-Customizer-PS-v2.6.0.ps1".

 

Now, I don't know how to run "ESXi-Customizer-PS-v2.6.0.ps1" so that the "net-alx-2.0.0.6b.x86_64.vib" is injected into the ISO file that I possess and for which I have a license "Vmware-ESXi-6.0.0-7967664-Custom-Cisco-6.0.3.4.iso".

 

Can you please help me?

Best regards.

cannot find Vmware.* modules 6.5 after upgrading powershell to 5.1

$
0
0

powershell ISE cannot find the powercli modules after upgrading powershell to 5.1 from 3

 

any idea?

 

 

 

get-module -listavailable

 

does not show anything from vmware

 

also tried running

 

& 'C:\Program Files (x86)\VMware\Infrastructure\PowerCLI\Scripts\Initialize-PowerCLIEnvironment.ps1'

 

but I am still not seeing the powercli modules in ISE

Import-Module : VMware.VimAutomation.Cloud module is not currently supported on the Core edition of PowerShell.

$
0
0

in powercli 10 on powershell version :

Name                           Value                                                                                                                                                                                                                      

----                           -----                                                                                                                                                                                                                      

PSVersion                      6.0.2                                                                                                                                                                                                                      

PSEdition                      Core                                                                                                                                                                                                                       

GitCommitId                    v6.0.2                                                                                                                                                                                                                     

OS                             Linux 3.10.0-862.3.2.el7.x86_64 #1 SMP Mon May 21 23:36:36 UTC 2018                                                                                                                                                        

Platform                       Unix                                                                                                                                                                                                                       

PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                                                                                    

PSRemotingProtocolVersion      2.3                                                                                                                                                                                                                        

SerializationVersion           1.1.0.1                                                                                                                                                                                                                    

WSManStackVersion              3.0

vm information script powershell

$
0
0

I am trying to write a script to get all of the information for my vm infrastructure. Using powercli and powershell I have all of my information and variables figured out thanks to this forum. I just figure out how to format and export them to csv in order to put into excel. These currently are my variables.

$VmInfo = Get-VM

$VMS = ($VmInfo).Name

$VMSysInfo = Get-VMGuest -VM $VmInfo

$Cluster_initial = &{foreach($vm in Get-VM){

 

Get-Datastore -RelatedObject $vm |

 

Select @{N='Cluster';E={Get-Cluster -VMHost $vm.VMhost | select -ExpandProperty Name}}}}

$cluster = $cluster_initial.cluster

 

$ESX_IHOST = ($VmInfo).VMHost.name

$VM_Name = ($VmInfo).name

$Power_Status = ($VmInfo).PowerState

$Memory_Allocated = ($VmInfo).MemoryGB

$CPU_Allocated = ($VmInfo).NumCpu

$StorageAllocated = ($VmInfo).ProvisionedSpaceGB

$DNS_Name = ($VmInfo).ExtensionData.Guest.Hostname

$Ip_Initial = Get-VM | Select Name, @{N="IP";E={@($_.guest.IPaddress[0])}}

$IP_Address = $Ip_Initial.IP

$vCenterServer = ($VmInfo).ExtensionData.Client.ServiceUrl.Split('/')[2].trimend(":443")

$cluster = $cluster_initial.cluster

What command do I use to change the IP of an ESXi host?

$
0
0

Hello,

 

I have to re-ip a bunch of ESXi hosts into a different subnet.  I've got a script that will connect to vCenter, let me select the datacenter, select the host, remove the host from vCenter (as the host is also having a fqdn change), disconnect from vCenter, connect directly to the host and then try to reconfigure the host.  I understand it can't be all done in one command, but I'm not sure why it's failing, or what the exact command is.  Is it Set-VMHostNetwork or Set-VMHostNetworkAdapter?  What I have is this:

 

$ESXIP = Read-Host "Enter new IP address"

Write-Host "Configure new management network"

Get-VMHost "$ESXhost" | Set-VMHostNetworkAdapter -VirtualSwitch "vSwitch0" -PortGroup "Management Network" -IP "$ESXIP" -SubnetMask "255.255.255.0" -ManagementTrafficEnabled:$true -Confirm:$false | out-null

Write-Host "Configure new DNS servers"

Get-VMHost "$ESXhost" | Get-VMHostNetwork | Set-VMHostNetwork -DnsAddress 8.8.8.8,8.8.8.8 -DnsFromDhcp $false

Write-Host "Change VMkernel Gateway"

$net = Get-VMHostNetwork

$net | Set-VMHostNetwork -VMKernelGateway 1.2.3.4 | out-null

 

But I always seem to get a failure on the setting of the IP, which of course stops it from doing the gateway:

 

Set-VMHostNetworkAdapter : Parameter set cannot be resolved using the

specified named parameters.

At C:\Users\emcclure\Desktop\GenScripts\GenUpdateHostIPSettings.ps1:39 char:25

+ ... $ESXhost" | Set-VMHostNetworkAdapter -VirtualSwitch "vSwitch0" -PortG ...

+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : InvalidArgument: (:) [Set-VMHostNetworkAdapter],

    ParameterBindingException

    + FullyQualifiedErrorId : AmbiguousParameterSet,VMware.VimAutomation.ViCor

   e.Cmdlets.Commands.Host.SetVMHostNetworkAdapter

 

I'd figure after this I'd either want to reboot the host or somehow get the network to restart and then add it back to vCenter with the new fqdn.  But how to get the above to work?  Any help appreciated.  Thanks in advance.

ILO information by Script

$
0
0

I would like to ask if someone can try this script to check ILO information's I just need to know if is valid, I got these info when I run:

 

Header 1

   

iLOFirmwareHPSmartArraySystemBIOS
Hewlett-Packard BMC Firmware (node 0) 46:10000 2.20HP Smart Array Controller HPSA1 Firmware 6.64HP System BIOS I31 2015-04-01 00:00:00.000
Hewlett-Packard BMC Firmware (node 0) 46:10000 2.40HP Smart Array Controller HPSA1 Firmware 3.56HP System BIOS I36 2015-12-28 00:00:00.000
Hewlett-Packard BMC Firmware (node 0) 46:10000 2.40HP Smart Array Controller HPSA1 Firmware 4.02HP System BIOS I36 2015-12-28 00:00:00.000
Hewlett-Packard BMC Firmware (node 0) 46:10000 2.40HP Smart Array Controller HPSA1 Firmware 3.56HP System BIOS I36 2015-12-28 00:00:00.000
Hewlett-Packard BMC Firmware (node 0) 46:10000 2.40HP Smart Array Controller HPSA1 Firmware 3.56HP System BIOS I36 2015-12-28 00:00:00.000

 

So, I suppose 2.20, 2.40 are ILO version...thanks

 

Get-View -ViewType HostSystem -Property Name, Runtime.HealthSystemRuntime.SystemHealthInfo.NumericSensorInfo -SearchRoot (Get-View -ViewType ClusterComputeResource -Property Name -Filter @{"Name" = "^$([RegEx]::escape($strHostsClusterName))$"}).MoRef | %{    $arrNumericSensorInfo = @($_.Runtime.HealthSystemRuntime.SystemHealthInfo.NumericSensorInfo)    # HostNumericSensorInfo for BIOS, iLO, array controller    $nsiBIOS = $arrNumericSensorInfo | ? {$_.Name -like "*System BIOS*"}    $nsiArrayCtrlr = $arrNumericSensorInfo | ? {$_.Name -like "HP Smart Array Controller*"}    $nsiILO = $arrNumericSensorInfo | ? {$_.Name -like "Hewlett-Packard BMC Firmware*"}    New-Object PSObject -Property @{        VMHost = $_.Name        "SystemBIOS" = $nsiBIOS.name        "HPSmartArray" = $nsiArrayCtrlr.Name        "iLOFirmware" = $nsiILO.Name        }} | Export-Csv -Path C:\Users\gemela\ILO_info.csv -NoTypeInformation -UseCulture

Display number of LUN

$
0
0

Hello,

I would like display the LunID in my script but i dont make this. My script is : 

-------------------------------------------------------------------------------------------------------------------------------------

$VMS = Get-VM -Name "MyVM" | get-HardDisk -DiskType "RawPhysical", "RawVirtual"

$report = @()

foreach ($vm in $VMS) {

$row = "" | select Parent, DiskType, ScsiCanonicalName, Persistence, Filename,"LunID", CapacityGB

$row.Parent = $vm.Parent

$row.Disktype = $vm.disktype

$row.scsiCanonicalName = $vm.ScsiCanonicalName

$row.Persistence = $vm.Persistence

$row.Filename = $vm.Filename

$row."LunID" = ''

$row.CapacityGB = $vm.CapacityGB

$report += $row

}

 

$report | export-csv -Path "Path" -NoTypeInformation -UseCulture

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------

VM                       DiskType                    LunName             Datastore                       Lunid                                                            Size

My VM                RawPhyscial               naa.xxxxxx           DatastoreName            Number of LUN (Exemple : 5)                   XGB

 

Thank you very much for help

 

Mehdi

$VMS = Get-VM -Name XS20792* | get-HardDisk -DiskType "RawPhysical", "RawVirtual"
 
$report = @()
foreach ($vm in $VMS) {
$row = "" | select Parent, DiskType, ScsiCanonicalName, Persistence, Filename,"LunID", CapacityGB
$row.Parent = $vm.Parent
$row.Disktype = $vm.disktype
$row.scsiCanonicalName = $vm.ScsiCanonicalName
$row.Persistence = $vm.Persistence
$row.Filename = $vm.Filename
$row."LunID" = ''
$row.CapacityGB = $vm.CapacityGB
$report += $row
}
 
$report | export-csv -Path "c:\mehdi\scripts_test\DiskType.csv" -NoTypeInformation -UseCulture

geting inventory from powercli and rvtools

$
0
0

Hi Luc ,

 

Good morning ,

could you please epain the mechanism difference in fetching vsphere info using powercli and rvtools.

Unable to get MAC, Duplex, MTU, Speed, Model

$
0
0

Hi,

 

Please help, I am unable to get the MAC, Duplex, MTU, Speed, Model, there is no error but shows blank

 

function Get-NICDetails {

[CmdletBinding()]

param(

    [Parameter(Mandatory=$True, ValueFromPipeline=$False, Position=0)]

    [ValidateNotNullorEmpty()]

        [String] $Clustername 

        )

Begin {

    $Validate = $True

    if (($myCluster = Get-Cluster -Name $Clustername).count -lt 1) {

       $Validate = $False

       thow "No Cluster '$myCluster' found!"

    }

  }

Process {

    $MyView = @()

    if ($Validate -eq $True) {

          foreach ($myVMhost in ($myCluster | Get-VMHost)) {

            $esxcli2 = Get-ESXCLI -VMHost $myVMhost -V2

            $niclist = $esxcli2.network.nic.list.invoke()

            $nicdetails = @()

            foreach ($nic in $niclist) {

                $args = $esxcli2.network.nic.get.createargs()

                $args.nicname = $nic.name

                $nicdetail = $esxcli2.network.nic.get.Invoke($args)

                $nicdetails += $nicdetail

                }

            ForEach ($nicdetail in $nicdetails){

                $NICReport = [PSCustomObject] @{

                        Host = $myVMhost.Name

                        Version = $myVMhost.version

                        Host_Manufacturer = $myVMhost.Manufacturer

                        Host_Model = $myVMhost.Model

                        SerialNumber = $myVMhost.ExtensionData.Hardware.SystemInfo.OtherIdentifyingInfo |Where-Object {$_.IdentifierType.Key -eq "Servicetag"} |Select-Object -ExpandProperty IdentifierValue

                        vmnic = $nicdetail.Name

                        MAC = $nicdetail.MACAddress

                        LinkStatus = $nicdetail.LinkStatus

                        BusInfo = $nicdetail.driverinfo.BusInfo

                        Duplex = $nicdetail.Duplex

                        MTU = $nicdetail.MTU

                        Speed = $nicdetail.Speed

                        Model = $nicdetail.Description

                        Driver = $nicdetail.driverinfo.Driver

                        FirmwareVersion = $nicdetail.driverinfo.FirmwareVersion

                        DriverVersion = $nicdetail.driverinfo.Version

                        }

                $MyView += $NICReport

                }

        }       

       $MyView

    }

}

}

get esxi storage path details using powercli

$
0
0

ran the below script but getting an error saying "Get-ScsiLunPath        Value cannot be null" , any help would be appreciated!!

 

$results= @()
foreach ($VMHost in $VMHosts) {
[ARRAY]$HBAs = $VMHost | Get-VMHostHba -Type "FibreChannel"

    foreach ($HBA in $HBAs) {
    $scsiluns = Get-ScsiLun -Hba $HBA -LunType "disk"
    foreach ( $scsilun in $scsiluns) {
    $pathState = $scsilun | Get-ScsiLunPath | Group-Object -Property state
    $pathStateActive = $pathState | ? { $_.Name -eq "Active"}
    $pathStateDead = $pathState | ? { $_.Name -eq "Dead"}
    $pathStateStandby = $pathState | ? { $_.Name -eq "Standby"}
    $results += "{0},{1},{2},{3},{4},{5}" -f $VMHost.Name, $HBA.Device, $VMHost.Parent, [INT]$pathStateActive.Count, [INT]$pathStateDead.Count, [INT]$pathStateStandby.Count
    }
}
}

ConvertFrom-Csv -Header "VMHost","HBA","Cluster","Active","Dead","Standby" -InputObject $results | Ft -AutoSize

 

ERROR:


Get-ScsiLunPath : 12/2/2015 1:49:18 PM    Get-ScsiLunPath        Value cannot be null.
Parameter name: array   
At line:13 char:29
+     $pathState = $scsilun | Get-ScsiLunPath | Group-Object -Property state
+                             ~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-ScsiLunPath], VimException
    + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.Host.GetScsiLunPath

Copy-DatastoreItem error - 404 File Not Found

$
0
0

So I am trying to copy a file down from a datastore on my host and having this issue:

 

Copy-DatastoreItem : 1/26/2012 6:35:54 AM VimDatastore Download of file 'https://usewdesx015:443/fo

lder%2fLogs%2fdupes.report?dcPath=ha-datacenter&dsName=LOCAL-USEWDESX015' failed. Error message: The remote s

erver returned an error: (404) Not Found.

At line:1 char:19

+ Copy-DatastoreItem <<<< -Item "ds:\Logs\dupes.report" -Destination "c:\dupes\" -Force

+ CategoryInfo : NotSpecified: (:) [Copy-DatastoreItem], VimException

+ FullyQualifiedErrorId : Client20_StorageServiceImpl_DownloadFile_DownloadFailed,VMware.VimAutomation.V

iCore.Cmdlets.Commands.CopyDatastoreItem

 

I can verify that the file I am looking for is there and also that I am connected to the datastore correctly.

 

PS ds:\Logs> ls

  

Datastore path: [LOCAL-USEWDESX015] Logs

LastWriteTime Type Length Name

------------- ---- ------ ----

6/30/2011 5:15 PM File 13283 esxupdate.debug

1/26/2012 1:54 PM File 8197 dupes.report

 

Here is my code:

 

 

CurrentLocation :

Name : ds

Provider : VMware.VimAutomation.Core\VimDatastore

Root : \usewdesx015@443\ha-datacenter\LOCAL-USEWDESX015

Description :

Credential : System.Management.Automation.PSCredential

Used :

Free :

  

PSPath : VMware.VimAutomation.Core\VimDatastore::\usewdesx015@443\ha-datacenter\LOCAL-USEWDESX015\

Logs\esxupdate.debug

PSParentPath : VMware.VimAutomation.Core\VimDatastore::\usewdesx015@443\ha-datacenter\LOCAL-USEWDESX015\

Logs

PSChildName : esxupdate.debug

PSDrive : ds

PSProvider : VMware.VimAutomation.Core\VimDatastore

PSIsContainer : False

Length : 13283

DatastoreId : Datastore-4d931f68-983f5bd4-5450-1cc1de2607b2

Datastore : LOCAL-USEWDESX015

Name : esxupdate.debug

FolderPath : [LOCAL-USEWDESX015] Logs

DatastoreFullPath : [LOCAL-USEWDESX015] Logs/esxupdate.debug

FullName : vmstores:\usewdesx015@443\ha-datacenter\LOCAL-USEWDESX015\Logs\esxupdate.debug

ItemType : File

LastWriteTime : 6/30/2011 5:15:39 PM

Uid : /VIServer=blackrock\svcvmscp@usewdesx015:443/Datastore=Datastore-4d931f68-983f5bd4-5450-1

cc1de2607b2/DatastoreItem=[LOCAL-USEWDESX015] Logs&slash;esxupdate.debug/

  

PSPath : VMware.VimAutomation.Core\VimDatastore::\usewdesx015@443\ha-datacenter\LOCAL-USEWDESX015\

Logs\dupes.report

PSParentPath : VMware.VimAutomation.Core\VimDatastore::\usewdesx015@443\ha-datacenter\LOCAL-USEWDESX015\

Logs

PSChildName : dupes.report

PSDrive : ds

PSProvider : VMware.VimAutomation.Core\VimDatastore

PSIsContainer : False

Length : 8197

DatastoreId : Datastore-4d931f68-983f5bd4-5450-1cc1de2607b2

Datastore : LOCAL-USEWDESX015

Name : dupes.report

FolderPath : [LOCAL-USEWDESX015] Logs

DatastoreFullPath : [LOCAL-USEWDESX015] Logs/dupes.report

FullName : vmstores:\usewdesx015@443\ha-datacenter\LOCAL-USEWDESX015\Logs\dupes.report

ItemType : File

LastWriteTime : 1/26/2012 1:54:41 PM

Uid : /VIServer=blackrock\svcvmscp@usewdesx015:443/Datastore=Datastore-4d931f68-983f5bd4-5450-1

cc1de2607b2/DatastoreItem=[LOCAL-USEWDESX015] Logs&slash;dupes.report/

 

Copy-DatastoreItem : 1/26/2012 6:33:34 AM VimDatastore Download of file 'https://usewdesx015:443/fo

lder%2fLogs%2fdupes.report?dcPath=ha-datacenter&dsName=LOCAL-USEWDESX015' failed. Error message: The remote s

erver returned an error: (404) Not Found.

At C:\software\VMWareScripts\PROD\AdminScripts\Automation\CheckDupesReport.ps1:15 char:19

+ Copy-DatastoreItem <<<< -Item "ds:\Logs\dupes.report" -Destination "c:\dupes\" -Force

+ CategoryInfo : NotSpecified: (:) [Copy-DatastoreItem], VimException

+ FullyQualifiedErrorId : Client20_StorageServiceImpl_DownloadFile_DownloadFailed,VMware.VimAutomation.V

iCore.Cmdlets.Commands.CopyDatastoreItem

 

 

 

 

 

The strangest part is that it will delete the file with no errors. Any help on this would be greatly appreciated.

 

Connect-VIServer hostname -User "user" -Password "password"

$datastore = Get-Datastore "DS Name"
New-PSDrive -Location $datastore -Name ds -PSProvider VimDatastore -Root "\"

Set-Location ds:\Logs

Get-ChildItem

Copy-DatastoreItem -Item "ds:\Logs\dupes.report" -Destination "c:\dupes\" -Force

del "ds:\Logs\dupes.report"

Disconnect-VIServer * -Confirm:$false

 

 

Here is my output:

 

 

Viewing all 14549 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>